
この戦略は,波のチャネル指標と資金流動指標を組み合わせて,トレンドの方向を識別し,トレンドを追跡する.この戦略は,15分間の時間周期で動作し,波のチャネルを通じて価格の方向を判断し,その後,資金流動指標を使用してトレンドを確認し,超短線のトレンドを追跡する.
波の通道指標 ((WaveTrend) は,価格のトレンド方向を効果的に識別することができる.それは,通道平均線,通道平均価格,通道インデックスで構成されている.通道平均線は,価格の指数移動平均線であり,価格トレンドを反映する.通道平均線は,通道平均線の移動平均で,通道平均線を定位するために使用される.通道インデックスは,通道平均線から価格の偏差を反映し,超買超売信号を与える.
資金流動指数 (CMF) は,資金の流入と流出を判断し,トレンドを確認する.この指標は,取引量調整後の蓄積/派生ラインに基づいて,買い手と売り手の力の対比を反映する.値が0近くで資金流入と流出のバランスを表示する.0未満は資金流出を表示し,0以上は資金流入を表示する.
この策略は15分周期で動作し,波動通路指標によって価格トレンドの方向を判断した後,資金流動指標を使用して確認し,その傾向を追跡する.具体的には,波動通路指標のチャネルインデックスが-60より低く,資金流動指標が-0.2より小さい場合,多額の取引を行う.波動通路指標のチャネルインデックスが60より高く,資金流動指標が-0.2より大きい場合,空白の取引を行う.条件付きの資金流動指標が主として,多額の取引の資金流動指標が0.18時より大きい場合,空白の資金流動指標が-0.18時より小さい場合,空白の取引を行う.
リスク対策:
この戦略は,波通路指標を用いてトレンドの方向を判断し,資金流動指標で確認し,超ショートラインのトレンド追跡操作を実現する.戦略の優点は,指標の組み合わせが合理的で,効率的にトレンドを追跡でき,15分周期の運用がショートライン操作に適していることにある.しかし,指標シグナル不正確さ,ポジション保持時間が短すぎるなどのリスクもある.将来,ストップ・ロース戦略,パラメータ最適化,信号フィルタリングの追加などの方法でさらに最適化することができ,戦略の安定性と収益率が向上する.
/*backtest
start: 2023-11-08 00:00:00
end: 2023-11-15 00:00:00
period: 1m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=3
strategy(title = "CMF - WaveTrend", shorttitle = "CMF - WaveTrend", overlay = true, pyramiding = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, currency = currency.EUR)
//Chaikin Money Flow
len = input(20, minval=1, title="Length")
mas = input(title="Aggregation", defval="SUM", options=["SUM", "EMA", "WMA"])
e = input(10.0, title="Volume Exponent (0-10 reduces & 10+ increases volume effect)")
p = input(false, title="Show in Percentage")
mvs = input(false, "Factor in Price (Money Volume)")
src=input(hlc3, title="Source for price factor")
trl = min(low,close[1]), trh = max(high,close[1]) // 'true range' fixes issues caused by gaps in price
wv = pow(volume,e/10.0)*(mvs ? src : 1)
ad = (trh==trl ? 0 : (2*close-(trh+trl))/tr(true))*wv
cmf = mas=="SUM" ? sum(ad, len)/sum(wv, len) : mas=="EMA" ? ema(ad, len)/ema(wv, len) : mas=="WMA" ? wma(ad, len)/wma(wv, len) : na
cmf_p = if p
50*cmf+50
else
cmf
b = p ? 50 : 0
//WaveTrend
n1 = input(10, "Channel Length")
n2 = input(21, "Average Length")
obLevel1 = input(60, "Over Bought Level 1")
obLevel2 = input(53, "Over Bought Level 2")
osLevel1 = input(-60, "Over Sold Level 1")
osLevel2 = input(-53, "Over Sold Level 2")
ap = hlc3
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)
wt1 = tci
wt2 = sma(wt1,4)
//
longCondition = wt1 < -60 and cmf < - 0.20
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
shortCondition = wt1 > 60 and cmf > 0.20
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short)
closeLongCondition = cmf_p > 0.18 ? true : false
closeShortCondition = cmf_p < -0.18 ? true : false
strategy.close("My Long Entry Id", when=(closeLongCondition == true))
strategy.close("My Short Entry Id", when=(closeShortCondition == true))