Bidirectional Trading Strategy Based on Moon Phases
Overview
This strategy trades both long and short based on moon phases, going long on new moons and going short on full moons.
Strategy Logic
The strategy calculates moon phases accurately based on dates using a custom function. Moon age less than 15 is a new moon, and between 15 and 30 a full moon. It generates long and short signals based on moon phases, opening long positions on new moons and short positions on full moons. It closes positions on reverse signals - closing longs on full moons and shorts on new moons.
Users can choose between "long on new moon, short on full moon" or vice versa. Boolean variables track if trades are currently open. It opens new trades when signals appear while no position is open, and closes current positions on reverse signals. Buy and sell markers are displayed visually.
Advantages
- Captures long-term trends using moon cycle periodicity
- Customizable display colors, fill, etc
- Choice of bidirectional strategies
- Clear open/close markers
- Customizable backtest start time for optimization
Risks
- Long moon cycle fails to capture short-term moves
- No stop loss can lead to heavy losses
- Fixed cycles prone to pattern formation
Risk Mitigation:
- Add other short-cycle indicators for multi-timeframe trading
- Implement stop loss
- Optimize position sizing to limit loss impact
Optimization Directions
The strategy can be improved by:
- Adding more indicators to filter signals and improve robustness
- Adding position sizing to optimize and lower loss impact
- Adding stop loss module to limit losses
- Optimizing open/close conditions to reduce slippage and improve win rate
Conclusion
The strategy exploits the periodicity of moon cycles to implement a bidirectional trading strategy based on new and full moons. It has clear signals, high customizability, and catches long-term trends well. But the inability to limit losses poses significant risks. It is recommended to combine short-cycle indicators and add position sizing and stop losses to further optimize the strategy.
/*backtest
start: 2024-01-01 00:00:00
end: 2024-01-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// ---------------------------© paaax----------------------------
// ---------------- Author1: Pascal Simon (paaax) ----------------- 1

