
この戦略は,均線交差に基づいて市場のトレンドの方向を判断し,トレンドを追跡する量化取引戦略である.この戦略は,購入と販売のタイミングを判断するために,複数の異なるパラメータの単純な移動平均の交差を適用する.
この戦略の主要な判断ルールは以下の通りです.
具体的には,20日線,30日線,50日線,60日線,200日線を5つの移動平均として使用している.20日線が50日線を上方から交差すると買入信号と判断し,10日線が30日線を下方から交差すると売出信号と判断する.異なるパラメータの平均線を使用して,より長期的およびより短期的なトレンド方向を判断することができる.
この均線交差に基づくトレンド追跡戦略は以下の利点があります.
この戦略にはいくつかのリスクがあります.
リスクを下げるために,平均線パラメータを調整し,パラメータの設定を最適化し,他の指標を使用して意思決定を補助することができます.
この戦略は,以下の点で改善できます.
この戦略は,非常に基本的なトレンド追跡戦略である. 均線交差原理を使用して,市場トレンドの方向を判断し,シンプルで有効で,容易に理解できる実装である. 我々は,より複雑な量的な取引に適用するために,この基礎を大きく拡張し,最適化することができます. 全体として,これは非常に良い戦略の基本枠組みである.
/*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")