
均線交差動量反転量化取引戦略は,ルールに基づくトレンド追跡システムで,そのシステムの核心論理は21周期指数移動平均 ((21 EMA)) を中心に展開する.戦略は,価格と21 EMAの関係性を監視し,価格が均線を横切るときは多し,均線を横切るときは空し,価格が再び均線を横切るときは平仓し,反転してポジションを開きます.この戦略には,カスタマイズされた取引期間越えのストップやストップ・ロス設定,最大取引回数制限,最初の利益後に取引を自動的にロックするなどのリスク制御が含まれています.
この戦略の核となる原則は,21のEMA周辺の価格動力の変化を捉え,トレンドフォローと反転取引を実現することです.具体的には:
戦略はまた,取引量重み平均価格 (VWAP) を補助的な参照指標として統合し,市場背景の追加情報を提供している.
これらの最適化方向は,戦略の安定性や適応性を高め,偽信号を軽減し,収益性を向上させることを目的としています.
均線交差動力転向量化取引戦略は,21 EMA交差に基づくトレンド追跡システムであり,論理的明晰さ,規則的厳格性の特徴を有する.価格と均線との関係を監視し,厳格なリスク管理機構と組み合わせることで,この戦略は,市場トレンドの転向点を効果的に捕捉し,同時にリスクを制御することができる.
戦略の主な優点は,簡潔で直感的な取引論理と完善な規律執行機構,特に初後に取引をロックする設計が,過剰取引と利益の回転を効果的に防止していることです.しかしながら,戦略には均線遅れ,単一の指標に過度依存などの潜在的リスクもあります.
将来の最適化の方向は,パラメータの動態化,多因子信号確認,リスク管理の強化,市場状態の分類などの側面に焦点を当てて,異なる市場環境における戦略の適応能力を向上させるべきである.これらの最適化によって,この戦略は,より堅牢で信頼性の高い量化取引システムになる見込みである.
DSPLNの方法の一部として,この戦略は”Do So Patiently Listening Now”の取引哲学を体現し,規律性と体系性を強調し,感情的な干渉を克服し,ルール執行に焦点を当てた取引の枠組みを提供する.
/*backtest
start: 2025-06-15 00:00:00
end: 2025-06-21 08:00:00
period: 3m
basePeriod: 3m
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT"}]
*/
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EnvisionTrades
//@version=5
strategy("DSPLN EMA Flip Strategy v6", overlay=true)
// 🔹 Inputs
startHour = input.int(8, "Start Hour")
startMinute = input.int(30, "Start Minute")
endHour = input.int(10, "End Hour")
endMinute = input.int(30, "End Minute")
useTPSL = input.bool(true, "Use TP/SL?")
tpPoints = input.int(40, "Take Profit (points)")
slPoints = input.int(20, "Stop Loss (points)")
// 🔹 Time Filter
isWithinTradingHours = (hour > startHour or (hour == startHour and minute >= startMinute)) and
(hour < endHour or (hour == endHour and minute < endMinute))
// 🔹 Indicators
ema21 = ta.ema(close, 21)
vwap = ta.vwap
plot(ema21, title="21 EMA", color=color.orange)
plot(vwap, title="VWAP", color=color.blue)
// 🔹 State Variables
var int tradesToday = 0
var bool lastTradeWon = false
var float entryPrice = na
var label winLabel = na
var int prevTradeCount = 0
// 🔹 Entry Conditions
longEntry = isWithinTradingHours and close > ema21 and close[1] <= ema21[1]
shortEntry = isWithinTradingHours and close < ema21 and close[1] >= ema21[1]
// 🔹 Exit Conditions
longExit = strategy.position_size > 0 and close < ema21
shortExit = strategy.position_size < 0 and close > ema21
// 🔹 Trade Control
canTrade = tradesToday < 5 and not lastTradeWon
// 🔹 Entry Logic
if canTrade and strategy.position_size == 0 and longEntry
strategy.entry("Long", strategy.long)
entryPrice := close
if useTPSL
strategy.exit("TP Long", from_entry="Long", stop=close - slPoints * syminfo.mintick, limit=close + tpPoints * syminfo.mintick)
if canTrade and strategy.position_size == 0 and shortEntry
strategy.entry("Short", strategy.short)
entryPrice := close
if useTPSL
strategy.exit("TP Short", from_entry="Short", stop=close + slPoints * syminfo.mintick, limit=close - tpPoints * syminfo.mintick)
// 🔹 EMA Manual Exit Logic
if longExit
strategy.close("Long")
tradesToday += 1
lastTradeWon := close > entryPrice
if lastTradeWon
winLabel := label.new(bar_index, high, "✅ WIN - No More Trades", style=label.style_label_down, color=color.green)
if shortExit
strategy.close("Short")
tradesToday += 1
lastTradeWon := close < entryPrice
if lastTradeWon
winLabel := label.new(bar_index, low, "✅ WIN - No More Trades", style=label.style_label_up, color=color.green)
// 🔹 Detect Closed Trades (TP/SL exits)
tradeCount = strategy.closedtrades
if tradeCount > prevTradeCount
closedProfit = strategy.netprofit - strategy.netprofit[1]
tradesToday += 1
lastTradeWon := closedProfit > 0
if lastTradeWon
winLabel := label.new(bar_index, high, "✅ TP WIN - No More Trades", style=label.style_label_down, color=color.green)
prevTradeCount := tradeCount
// 🔹 Reset Daily
if (hour == endHour and minute == endMinute)
tradesToday := 0
lastTradeWon := false
entryPrice := na
prevTradeCount := 0
if not na(winLabel)
label.delete(winLabel)