
この戦略は,トレンド指標に基づく量化取引戦略である.これは,主に3つの異なる周期の移動平均を使用し,ATR指標と組み合わせて市場の傾向を追跡し,上場のタイミングを判断するのに役立ちます.
この戦略は,9日目 (短期),15日目 (中期),24日目 (長期) の3つの移動平均を使用している.その中,9日目と15日目はトレンドの方向と入札のタイミングを判断するために使用され,24日目はストップとストロスを判断するために使用されている.同時に,この戦略はATR指標を組み合わせて,移動平均を動的に調整し,市場の変動により適した状態にします.
具体的には,短期移動平均線が中期移動平均線を突破し,閉店価格が短期移動平均線より大きいときは,市場がトレンドに入っていることを示し,この時点で多項ポジションを確立することができる.短期移動平均線が長期移動平均線を突破し,または閉店価格が長期移動平均線より低いときは,トレンドが逆転することを示す.
さらに,この戦略は,トレンドの方向を直感的に示すために柱状図の色を使用しています. 短期線が中期線より大きい場合は緑色で,長期線より小さい場合は赤色です.
この戦略は,全体としてより堅牢なトレンド追跡戦略である。中長線トレンドを効果的に捕捉し,同時にもストップ・ストップ・メカニズム制御リスクを設定する。しかし,この戦略は,パラメータと市場状態に比較的敏感であり,より多くの市場環境に対応するためにさらに最適化する必要がある。
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
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/
// © ceyhun
//@version=4
strategy("Chaloke System Strategy",overlay=true)
P1=input(9,title="ShortTerm Period")
P2=input(15,title="MidTerm Period")
P3=input(24,title="LongTerm Period")
P4=input(5,title="Invesment Term")
P5=input(5,title="ATR Period")
Barcolor=input(true,title="Barcolor")
Sm=2*P5/10
ATRX=Sm*atr(P4)
S=ema(close,P1)-ATRX
M=ema(close,P2)-ATRX
Lg=ema(close,P3)-ATRX
Sht=iff(close==highest(close,3),S,ema(close[1],P1)-ATRX)
Mid=iff(close==highest(close,3),M,ema(close[1],P2)-ATRX)
Lng=iff(close==highest(close,3),Lg,ema(close[1],P3)-ATRX)
colors=iff(Sht>Mid and close > Sht ,color.green,iff(close < Lng or Sht<Lng,color.red,color.black))
plot(Sht,"Short",color=color.green,linewidth=2)
plot(Mid,"Middle",color=color.black,linewidth=2)
plot(Lng,"Long",color=color.red,linewidth=2)
barcolor(Barcolor ? colors :na)
long = crossover(Sht,Mid) and close > Sht
short = crossunder(Sht,Lng) or close < Lng
if long
strategy.entry("Long", strategy.long, comment="Long")
if short
strategy.entry("Short", strategy.short, comment="Short")
alertcondition(long, title='Long', message='Chaloke System Alert Long')
alertcondition(short, title='Short', message='Chaloke System Alert Short')