Multi-Phase Lunar Momentum Rotation Strategy

月相策略 动量交易 时间序列分析 天文周期 逆转交易 MPLS TSA MR
Created on: 2025-05-30 11:20:26 Modified on: 2025-05-30 11:20:26
Copy: 2 Number of hits: 284
avatar of ianzeng123 ianzeng123
2
Follow
319
Followers

 Multi-Phase Lunar Momentum Rotation Strategy  Multi-Phase Lunar Momentum Rotation Strategy

Overview

The Multi-Phase Lunar Momentum Rotation Strategy is a trading system based on lunar cycles, utilizing the potential periodic influence of full and new moons on market behavior to make trading decisions. This strategy assumes that markets exhibit predictable patterns during specific lunar phases, providing traders with potential entry and exit opportunities. The core approach involves establishing long positions near full and new moons, and closing or rotating positions when the opposite lunar phase occurs, creating a continuous trading cycle.

Strategy Principles

The core principle of this strategy is leveraging astronomical cycles (particularly lunar phases) and their potential influence on market sentiment and price movements. In its implementation, the strategy includes the following key components:

  1. Lunar Phase Database: The strategy pre-defines exact times for full and new moons throughout 2025, including month, day, hour, and minute. This data is stored in two separate arrays corresponding to full and new moon times.

  2. Proximity Detection Function: The strategy implements a function called isNearMoon to determine whether the current time is near a specified lunar phase. This function accepts a lunar phase array and a time threshold as parameters, calculating the difference between the current time and lunar phase time. If the difference falls within the threshold range (set to ±12 hours in the code), it returns true.

  3. Signal Generation Logic:

    • When near a full moon, the strategy generates a “Buy on Full” signal while closing any positions previously established during a new moon
    • When near a new moon, the strategy generates a “Buy on New” signal while closing any positions previously established during a full moon
  4. Visual Indicators: The strategy marks the occurrence of full and new moons on the chart with differently colored and positioned labels. Green upward labels indicate full moons, while orange downward labels indicate new moons, enhancing the strategy’s visualization and user experience.

This strategy uses time as the primary signal source rather than traditional price action or technical indicators, representing an alternative trading approach.

Strategy Advantages

  1. Simple and Clear Trading Rules: The strategy rules are intuitive and easy to understand, avoiding complex mathematical formulas or indicator calculations, which reduces implementation difficulty.

  2. Independent of Market Noise: Since trading signals are entirely based on predetermined astronomical events rather than market price fluctuations, this strategy is less affected by market noise and short-term volatility.

  3. Long-term Applicability: Lunar phases are astronomically predictable phenomena, meaning trading signals can be determined far in advance, facilitating long-term trading plan development.

  4. Psychological Advantage: Predetermined entry and exit points reduce the possibility of emotional trading, allowing traders to strictly follow the strategy without being influenced by market fear or greed.

  5. Simplified Money Management: The strategy defaults to using a percentage of account equity (100%) for trading, simplifying the money management process, although this might need adjustment to more conservative levels in actual application.

  6. Visual Assistance: The strategy clearly marks trading signal points on the chart, helping traders intuitively understand and monitor strategy execution.

Strategy Risks

  1. Lack of Price Consideration: The strategy completely ignores market factors such as price levels, trends, and volatility, potentially leading to trades under unfavorable market conditions.

  2. Fixed Time Range Limitation: The code only includes lunar phase data for 2025, making the strategy inoperable beyond this time range without regular data updates.

  3. Absence of Stop-Loss Mechanism: The strategy does not implement any form of stop-loss protection, which could lead to serious losses during extreme market volatility.

  4. Cycle Dependency Risk: If the correlation between lunar phases and market behavior is unstable or changes over time, the strategy’s effectiveness will be compromised.

  5. Parameter Rigidity: The strategy uses a fixed time threshold (±12 hours) without flexibility to adapt to different markets or varying intensities of lunar phase influence.

  6. Unidirectional Trading: Despite rotating between different lunar phases, the strategy is limited to long positions only, potentially missing opportunities in short-selling scenarios.

To mitigate these risks, it is recommended to: - Add filters based on market conditions - Implement appropriate stop-loss strategies - Expand the database to include a longer time range - Optimize the time threshold parameters - Consider adding short-selling strategies

Strategy Optimization Directions

  1. Incorporate Technical Indicators: Combine lunar phase signals with traditional technical indicators (such as moving averages, RSI, MACD, etc.) to execute trades only when technical indicators confirm lunar phase signals, improving accuracy.

  2. Dynamic Time Thresholds: Analyze historical data to determine optimal trading time windows for different lunar phases, as the duration and intensity of market influence may vary between full and new moons.

  3. Add Short-Selling Logic: Consider implementing short-selling strategies during specific lunar phase transitions, especially if historical data indicates that certain phase transitions typically coincide with market declines.

  4. Segment Market Conditions: Analyze the performance of the lunar strategy under different market conditions (uptrends, downtrends, sideways markets) and adjust strategy parameters accordingly.

  5. Optimize Money Management: Instead of using a fixed 100% of account equity, implement dynamic position sizing calculations based on market volatility and account risk tolerance.

  6. Add Lunar Phase Strength Factors: Consider special types of lunar phases (such as supermoons, blue moons, etc.) and their potential additional influence, assigning different signal weights to different types of lunar phases.

  7. Expand Data Sources: Extend the strategy to consider other astronomical factors (such as solar eclipses, lunar eclipses, planetary aspects) and their combined effects with lunar phases.

  8. Backtest Period Optimization: Perform multi-timeframe backtesting to determine which time frames (daily, weekly, monthly) the strategy performs best on, and optimize accordingly.

Conclusion

The Multi-Phase Lunar Momentum Rotation Strategy represents a unique trading approach that attempts to leverage astronomical cycles rather than traditional technical analysis to guide trading decisions. While this method offers advantages in simplicity, intuitiveness, and independence from market noise, it also faces challenges in ignoring price dynamics, lacking risk management, and over-reliance on a single factor.

This strategy is best suited as a component of a more comprehensive trading system rather than being used independently. By combining lunar phase signals with traditional technical analysis and strict risk management, traders can potentially improve the reliability and robustness of the strategy.

Ultimately, like all trading strategies, the Multi-Phase Lunar Momentum Rotation Strategy requires thorough backtesting and forward testing to validate its effectiveness across different market environments. Traders should recognize that while there may be some correlation between lunar phases and market behavior, this correlation might be unstable and influenced by other factors.

Strategy source code
/*backtest
start: 2024-05-30 00:00:00
end: 2025-05-29 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy("2-Way Moon Phase Strategy (Buy Full/New, Sell Opposite)", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// === FULL MOON TIMES (2025) ===
fullMoonTimes = array.new_int()
array.push(fullMoonTimes, timestamp(2025, 1, 13, 10, 27))
array.push(fullMoonTimes, timestamp(2025, 2, 12, 2, 53))
array.push(fullMoonTimes, timestamp(2025, 3, 13, 17, 54))
array.push(fullMoonTimes, timestamp(2025, 4, 12, 6, 21))
array.push(fullMoonTimes, timestamp(2025, 5, 11, 17, 55))
array.push(fullMoonTimes, timestamp(2025, 6, 10, 3, 20))
array.push(fullMoonTimes, timestamp(2025, 7, 9, 11, 55))
array.push(fullMoonTimes, timestamp(2025, 8, 7, 19, 39))
array.push(fullMoonTimes, timestamp(2025, 9, 6, 3, 21))
array.push(fullMoonTimes, timestamp(2025, 10, 5, 11, 47))
array.push(fullMoonTimes, timestamp(2025, 11, 3, 21, 18))
array.push(fullMoonTimes, timestamp(2025, 12, 3, 8, 15))

// === NEW MOON TIMES (2025) ===
newMoonTimes = array.new_int()
array.push(newMoonTimes, timestamp(2025, 1, 29, 0, 37))
array.push(newMoonTimes, timestamp(2025, 2, 27, 12, 27))
array.push(newMoonTimes, timestamp(2025, 3, 29, 0, 58))
array.push(newMoonTimes, timestamp(2025, 4, 27, 13, 39))
array.push(newMoonTimes, timestamp(2025, 5, 27, 2, 22))
array.push(newMoonTimes, timestamp(2025, 6, 25, 17, 8))
array.push(newMoonTimes, timestamp(2025, 7, 25, 8, 12))
array.push(newMoonTimes, timestamp(2025, 8, 23, 23, 7))
array.push(newMoonTimes, timestamp(2025, 9, 22, 13, 50))
array.push(newMoonTimes, timestamp(2025, 10, 22, 3, 26))
array.push(newMoonTimes, timestamp(2025, 11, 20, 15, 48))
array.push(newMoonTimes, timestamp(2025, 12, 20, 3, 44))

// === FUNCTION TO DETECT NEARBY MOON PHASE ===
isNearMoon(array<int> moonArray, int thresholdMinutes) =>
    result = false
    for i = 0 to array.size(moonArray) - 1
        moonTime = array.get(moonArray, i)
        timeDiff = math.abs(time - moonTime)
        if timeDiff <= thresholdMinutes * 60 * 1000
            result := true
    result

// === SIGNALS ===
isFullMoon = isNearMoon(fullMoonTimes, 720)  // ±12 hours
isNewMoon  = isNearMoon(newMoonTimes, 720)

// === STRATEGY LOGIC ===
// Use one position with reversal logic
if isFullMoon
    strategy.entry("Buy on Full", strategy.long)
    strategy.close("Buy on New")  // Close previous New Moon trade

if isNewMoon
    strategy.entry("Buy on New", strategy.long)
    strategy.close("Buy on Full")  // Close previous Full Moon trade

// === VISUAL LABELS ===
plotshape(isFullMoon, title="Full Moon", location=location.belowbar, color=color.green, style=shape.labelup, text="Full")
plotshape(isNewMoon,  title="New Moon",  location=location.abovebar, color=color.orange, style=shape.labeldown, text="New")