
Die Strategie ist eine dynamische Trend-Tracking-Strategie, basierend auf einem Binary Average-System, das ein Kreuzsignal aus schnellen und langsamen Durchschnittskursen kombiniert und gleichzeitig eine Filterung der Durchschnittskurse einführt, um die Einstiegszeit zu optimieren und durch Kapitalmanagement und Risikokontrolle robuste Handelswirkung zu erzielen.
Die Strategie verwendet den einfachen Moving Average (SMA) mit 11 und 31 Zyklen als Hauptsignalsystem und verwendet den 5-Zyklen-Mittelwert als Filter. Wenn der Schnellkurs (SMA11) die langsame Linie (SMA31) durchschreitet und der Preis über der gefilterten Mittelwert liegt, erzeugt das System mehrere Signale. Wenn der Schnellkurs die langsame Linie unterhalb durchschreitet, ist das System ausgeglichen.
Die Strategie baut ein relativ robustes Trend-Tracking-System auf, das durch ein mehrfaches Gleichgewichtssystem erstellt wird. Obwohl es einige inhärente Einschränkungen gibt, kann die Stabilität und Profitabilität der Strategie durch vernünftige Optimierungen und Verbesserungen weiter verbessert werden.
/*backtest
start: 2024-10-01 00:00:00
end: 2024-10-31 23:59:59
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy('Nifty 30m SMA Crossover Long', overlay=true)
start = timestamp(2020, 1, 1, 0, 0)
end = timestamp(2024, 12, 31, 0, 0)
SlowSma = ta.sma(close, 31)
FastSma = ta.sma(close, 11)
FilterSma = ta.sma(close, 5)
plot(SlowSma, title='Sma 31', color=color.new(color.green, 0))
plot(FastSma, title='Sma 11', color=color.new(color.red, 0))
plot(FilterSma, title='Filter Sma 5', color=color.new(color.black, 0))
// strategy
LongEntry = FastSma > SlowSma and close > FilterSma
LongExit = FastSma < SlowSma
MyQty = 10000000 / close
// // Plot signals to chart
// plotshape(not LongExit and strategy.position_size > 0 and bIndicator, title='Hold', location=location.abovebar, color=color.new(color.blue, 0), style=shape.square, text='Hold', textcolor=color.new(color.blue, 0))
// plotshape(LongExit and bIndicator and strategy.position_size > 0, title='Exit', location=location.belowbar, color=color.new(color.red, 0), style=shape.triangledown, text='Sell', textcolor=color.new(color.red, 0))
// plotshape(LongEntry and strategy.position_size == 0 and bIndicator, '', shape.arrowup, location.abovebar, color.new(color.green, 0), text='Buy', textcolor=color.new(color.green, 0))
// plotshape(not LongEntry and strategy.position_size == 0 and bIndicator, '', shape.circle, location.belowbar, color.new(color.yellow, 0), text='Wait', textcolor=color.new(color.black, 0))
if time >= start and time < end
strategy.entry('Enter Long', strategy.long, qty=1, when=LongEntry)
strategy.close('Enter Long', when=LongExit)