
この戦略は,200日指数移動平均 ((200 EMA),成交量重量平均価格 ((VWAP) とキャピタルフロー指数 ((MFI) を組み合わせて買入シグナルを生成する.主な考え方は,この3つの指標の組み合わせを使用してトレンドの方向と強さを判断し,価格が200 EMAを突破し,VWAPとMFIの指標が確認された場合に取引シグナルを生成することである.同時に,トレンドフィルターとして上位時間周期の200 EMAを導入し,現在の時間周期と上位時間周期のトレンドが一致するときにのみ取引することである.さらに,価格の動きの連続性を判断することによって,信号の信頼性を高める.
この戦略は,200日EMA,VWAP,MFIの指標を組み合わせて,上級時間周期のトレンドと価格動向の連続性を考慮しながら,比較的安定したトレンド追跡取引システムを構築している.戦略は,複数の条件の総合的な判断によって偽信号をフィルターし,入場タイミングの正確性を向上させる.同時に,戦略のパラメータの柔軟性は,異なる市場と取引スタイルに応じて最適化することを可能にします.しかし,戦略には,不安定な市場やトレンドの転換点で損失が生じることや,パラメータの設定が不適切で不良なパフォーマンスを引き起こす可能性など,一定のリスクがあります.
/*backtest
start: 2023-05-08 00:00:00
end: 2024-05-13 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("200 EMA, VWAP, MFI Strategy - Visible Signals", overlay=true, pyramiding=0)
// Inputs for dynamic adjustments
buffer = input.float(0.2, title="EMA Buffer Percentage", step=0.1) / 100
higherTimeframe = input.timeframe("15", title="Higher Timeframe")
mfiBuyThreshold = input(60, title="MFI Buy Threshold")
mfiSellThreshold = input(40, title="MFI Sell Threshold")
consecutiveCloses = input.int(1, title="Consecutive Closes for Confirmation")
// Calculate the 200-period EMA
ema200 = ta.ema(close, 200)
emaBufferedHigh = ema200 * (1 + buffer)
emaBufferedLow = ema200 * (1 - buffer)
emaHigher = request.security(syminfo.tickerid, higherTimeframe, ta.ema(close, 200))
// VWAP calculation
vwap = ta.vwap(hlc3)
// Money Flow Index calculation
mfiLength = 14
mfi = ta.mfi(close, mfiLength)
// Plotting the indicators
plot(ema200, title="200 EMA", color=color.blue)
plot(vwap, title="VWAP", color=color.orange)
plot(mfi, title="MFI", color=color.purple)
hline(50, "MFI Reference", color=color.gray, linestyle=hline.style_dashed)
plot(emaHigher, title="Higher TF EMA", color=color.red)
// Price action confirmation
isUpTrend = ta.rising(close, consecutiveCloses)
isDownTrend = ta.falling(close, consecutiveCloses)
// Define entry conditions
longCondition = close > emaBufferedHigh and close > vwap and mfi > mfiBuyThreshold and close > emaHigher and isUpTrend
shortCondition = close < emaBufferedLow and close < vwap and mfi < mfiSellThreshold and close < emaHigher and isDownTrend
// Trading execution
if (longCondition)
strategy.entry("Buy", strategy.long)
if (shortCondition)
strategy.entry("Sell", strategy.short)
// Plot shapes for signals
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, size=size.small, title="Buy Signal", text="Buy")
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small, title="Sell Signal", text="Sell")