これは,自己適応リスク管理とダイナミックポジション調整を組み合わせた双均線金交差に基づく取引戦略である.この戦略は50日および200日単調移動平均 ((SMA)) を使用してトレンドを識別し,50日均線で200日均線を横切るときに買取シグナルを生成する.同時に,この戦略は,総口座価値の2.5%をベースにしたリスク管理方法を採用し,各取引のポジションの大きさを動的に計算し,相対的に200日均線に対するパーセンテージ・ストップを使用して利益を保護する.
この二均線金交差に基づく自適化リスク管理戦略は,古典的な技術分析方法と現代的なリスク管理技術を組み合わせることで,トレーダーに比較的安定した取引システムを提供している.それは中長期のトレンドを捕捉するだけでなく,リスクを効果的に制御することができ,安定した収益を追求する投資家に適しています.しかし,この戦略を使用するトレーダーは,市場の変化を注意深く観察し,実際の取引のパフォーマンスに基づいてパラメータを常に最適化する必要があります.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-09-24 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Golden Cross with 1.5% Stop-Loss & MA Exit", overlay=true)
// Define the 50-day and 200-day moving averages
ma50 = ta.sma(close, 50)
ma200 = ta.sma(close, 200)
// Entry condition: 50-day MA crosses above 200-day MA (Golden Cross)
goldenCross = ta.crossover(ma50, ma200)
// Exit condition: price drops below the 200-day MA
exitCondition = close < ma200
// Set the stop-loss to 1.5% below the 200-day moving average
stopLoss = ma200 * 0.985 // 1.5% below the 200-day MA
// Risk management (1.5% of total equity)
riskPercent = 0.025 // 1.5% risk
equity = strategy.equity
riskAmount = equity * riskPercent
// Calculate the distance between the entry price (close) and the stop-loss
stopDistance = close - stopLoss
// Calculate position size based on the risk amount and stop-loss distance
if (goldenCross and stopDistance > 0)
positionSize = riskAmount / stopDistance
strategy.entry("Long", strategy.long, qty=positionSize)
// Exit the trade when the price crosses below the 200-day moving average
if (exitCondition)
strategy.close("Long")
// Plot the moving averages on the chart for visualization
plot(ma50, color=color.blue, linewidth=2, title="50-day MA")
plot(ma200, color=color.red, linewidth=2, title="200-day MA")