Type/to search

Bidirectional Trading Strategy Based on Moon Phases

Common strategy
Created: 2024-02-21 16:15:25
Last modified: 2 years ago
1
Follow
1802
Followers

img

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

  1. Captures long-term trends using moon cycle periodicity
  2. Customizable display colors, fill, etc
  3. Choice of bidirectional strategies
  4. Clear open/close markers
  5. Customizable backtest start time for optimization

Risks

  1. Long moon cycle fails to capture short-term moves
  2. No stop loss can lead to heavy losses
  3. Fixed cycles prone to pattern formation

Risk Mitigation:

  1. Add other short-cycle indicators for multi-timeframe trading
  2. Implement stop loss
  3. Optimize position sizing to limit loss impact

Optimization Directions

The strategy can be improved by:

  1. Adding more indicators to filter signals and improve robustness
  2. Adding position sizing to optimize and lower loss impact
  3. Adding stop loss module to limit losses
  4. 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.

Source
Pine
/*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) ----------------
Strategy parameters
Strategy parameters
New Moon Color
Full Moon Color
Fill Background?
New Moon Background Color
Full Moon Background Color
strategy
Show Buy/Sell Signals
Long enabled
Short enabled
Backtesting From Year
And Month
And Day
And Hour
And Minute
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)