This strategy is a quantitative trading strategy that judges market trend direction based on moving average crossover and tracks the trend. It uses the crossovers of simple moving averages with different parameters to determine the entry and exit points.
The main judgment rules of this strategy are:
When the short-term moving average crosses above the long-term moving average from the bottom, it indicates that the market may be entering an uptrend, then go long;
When the short-term moving average crosses below the long-term moving average from the top, it indicates that the market may be entering a downtrend, then go short;
Use moving averages with different parameters to judge trends at different timescales and track trends at different levels.
Specifically, the strategy uses 5 moving averages - 20-day, 30-day, 50-day, 60-day and 200-day. When 20-day MA crosses above 50-day MA, it is a buy signal; When 10-day MA crosses below 30-day MA, it is a sell signal. Using MAs of different parameters can tell trends in both longer and shorter timescales.
This trend tracking strategy based on MA crossover has the following advantages:
There are also some risks with this strategy:
To reduce risks, we can adjust MA parameters, optimize parameter settings, and use other indicators to aid decision making.
We can optimize this strategy in the following areas:
This is a very basic trend tracking strategy. It uses MA crossover principle to determine market trend direction, simple and effective, easy to understand and implement. We can make lots of expansions and optimizations to make it suitable for more complex quantitative trading. Overall this is a great strategy framework to build upon.
/*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"}] */ //@version=5 strategy("Grafik Formasyonları Alım-Satım Stratejisi", overlay=true) // Inverse Head and Shoulders (İnverse Omuz-Baş-Omuz) ihs_condition = ta.crossover(ta.sma(close, 50), ta.sma(close, 200)) // Head and Shoulders (Omuz-Baş-Omuz) hs_condition = ta.crossunder(ta.sma(close, 50), ta.sma(close, 200)) // Flag Pattern (Bayrak Formasyonu) flag_condition = ta.crossover(ta.sma(close, 10), ta.sma(close, 30)) // Triangle Pattern (Trekgen Formasyonu) triangle_condition = ta.crossover(ta.sma(close, 20), ta.sma(close, 50)) // Pennant Pattern (Ters Bayrak Formasyonu) pennant_condition = ta.crossunder(ta.sma(close, 10), ta.sma(close, 20)) // Inverse Triangle Pattern (Ters Üçgen Formasyonu) inverse_triangle_condition = ta.crossunder(ta.sma(close, 30), ta.sma(close, 60)) // Alım-Satım Sinyalleri if (ihs_condition) strategy.entry("İHS_Long", strategy.long) if (hs_condition) strategy.close("İHS_Long") if (flag_condition) strategy.entry("Flag_Long", strategy.long) if (triangle_condition) strategy.entry("Triangle_Long", strategy.long) if (pennant_condition) strategy.entry("Pennant_Short", strategy.short) if (inverse_triangle_condition) strategy.close("Pennant_Short")template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6