
この戦略は,複数の均線システムとRSI指標に基づくトレンド追跡戦略である.この戦略は,20,50および200周期の移動平均の組み合わせを採用し,異なる均線間の位置関係を分析することによって市場の傾向を判断し,RSI指標と組み合わせて取引信号の確認を行う.この戦略は,ダイナミックなストップと利益の目標を設定し,ストップを追跡することで,既得の利益を保護する.
戦略の核心は,3つの平均線 (MA20,MA50,MA200) の間の相対的な位置関係を分析することによって市場動向を決定することである.戦略は18種類の異なる均線組み合わせのシナリオを定義し,均線交差と位置関係に焦点を当てている.短期平均線が長期平均線の上に位置するときは,多額の取引を傾向にすること;逆に,空白を傾向にすること.過度取引を避けるために,戦略はRSI指標をフィルタリング条件として導入し,RSIが70を下回ると多額の取引を許可し,30を超えると空白を許可する.戦略は1:10のリスク/利益比率設定を採用し,利益を保護するために25ポイントのトラッキングストップを使用する.
これは,構造が整った,論理が明確なトレンド追跡戦略である.RSI指標のフィルタリングと組み合わせた多重均線システムの配合の使用により,比較的信頼性の高い取引システムを形成している.戦略のリスク管理機構は合理的に設計されており,ストップを追跡することで,利益を保護し,早期に退場しない.戦略にはまだ最適化の余地があるが,全体的なフレームワークの設計は科学的で,実用的な応用価値がある.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Refined MA Strategy with Trailing Stop for 30m", overlay=true)
// Define the moving averages
TR20 = ta.sma(close, 20)
TR50 = ta.sma(close, 50)
TR200 = ta.sma(close, 200)
// Define the RSI for additional filtering
rsi = ta.rsi(close, 14)
// Define the scenarios
scenario1 = TR20 > TR50 and TR50 > TR200
scenario2 = TR50 > TR20 and TR20 > TR200
scenario3 = TR200 > TR50 and TR50 > TR20
scenario4 = TR50 > TR200 and TR200 > TR20
scenario5 = TR20 > TR200 and TR200 > TR50
scenario6 = TR200 > TR20 and TR20 > TR50
scenario7 = TR20 == TR50 and TR50 > TR200
scenario8 = TR50 == TR20 and TR20 > TR200
scenario9 = TR200 == TR50 and TR50 > TR20
scenario10 = TR20 > TR50 and TR50 == TR200
scenario11 = TR50 > TR20 and TR20 == TR200
scenario12 = TR20 > TR50 and TR50 == TR200
scenario13 = TR20 == TR50 and TR50 == TR200
scenario14 = TR20 > TR50 and TR200 == TR50
scenario15 = TR50 > TR20 and TR200 == TR50
scenario16 = TR20 > TR50 and TR50 == TR200
scenario17 = TR20 > TR50 and TR50 == TR200
scenario18 = TR20 > TR50 and TR50 == TR200
// Entry conditions
longCondition = (scenario1 or scenario2 or scenario5) and rsi < 70
shortCondition = (scenario3 or scenario4 or scenario6) and rsi > 30
// Execute trades based on scenarios with 50 points stop loss and 1:10 RR, using a trailing stop of 25 points
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Take Profit", from_entry="Long", limit=close + 250, trail_offset=25)
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Take Profit", from_entry="Short", limit=close - 250, trail_offset=25)