
この戦略は,価格が連続して8日間,SMPより上か下か5日後に反転する特性を利用して,中短線上の動力の効果を捉えるために使用する.価格が連続して8日間,SMPより下か5日目の線の後,1日目の閉店価格が再び5日目の線を突破するときに,多めに;価格が連続して8日間,SMPより上か5日目の閉店価格が再び5日目の線を突破するときに,空いてください.
SMAのパラメータを適切に調整することができる.入場条件を最適化し,偽突破を防ぐ.トレンド判断指標の強化効果を組み合わせることができる.
この戦略は,価格運動の状態を判断し,中短線価格の突破から逆転までのプロセスを捕捉し,震えを回避し,順調をベースにした取引戦略を実現する.鍵は,パラメータの設定と入場の判断が厳格で,ノイズに誤導されないようにすることであり,出場のストップロスは合理的で,損失が過大にならないようにすることである.トレンド判断指標を補足すると,この優れた効果を得ることができる.この戦略の論理は明確で理解しやすい,コードは簡潔で,深遠な研究に値する最適化.
/*backtest
start: 2023-11-04 00:00:00
end: 2023-12-04 00:00:00
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/
// © Marcuscor
//@version=5
// Inpsired by Linda Bradford Raschke: a strategy for trading momentum in futures markets
strategy("8D Run", initial_capital = 50000, commission_value = 0.0004)
SMA = ta.sma(close,5)
TrendUp = close >= SMA
TrendDown = close <= SMA
//logic to long
TriggerBuy = ta.barssince(close < SMA) >= 8
Buy = TriggerBuy[1] and TrendDown
strategy.entry("EL", strategy.long, when = Buy)
strategy.close(id = "EL", when = close > SMA)
// 1) color background when "run" begins and 2) change color when buy signal occurs
bgcolor(TriggerBuy? color.green : na, transp = 90)
bgcolor(Buy ? color.green : na, transp = 70)
// logic to short
TriggerSell = ta.barssince(close > SMA) >= 8
Sell = TriggerSell[1] and TrendUp
strategy.entry("ES", strategy.short, when = Sell)
strategy.close(id = "ES", when = close < SMA)
// 1) color background when "run" begins and 2) change color when sell signal occurs
bgcolor(TriggerSell ? color.red : na, transp = 90)
bgcolor(Sell ? color.red : na, transp = 70)