この戦略は,速やかに2つのArnaud Legoux移動平均 ((ALMA) を採用して取引信号判断を行う.ALMAは,従来の移動平均の改良であり,遅れを軽減し,曲線を平坦化することができる.この戦略は,速やかにALMAの上にゆっくりとしたALMAを穿越して買入信号を生成し,速やかにALMAの下にゆっくりとしたALMAを穿越して売出信号を生成し,同時に合成交差フィルターを組み合わせ,より安定した交差信号を形成する.
戦略の核心指標と取引ルールは以下の通りです.
急速ALMA:突破を捉えるために短い期数.
ALMA: 長い周期で大きなトレンドを判断する.
交差量フィルター:短期平均量よりも長期平均量で有効である.
複数の信号:高速ALMAを遅速ALMAに切り替え,交差量フィルタが有効である.
平多信号:高速ALMAの下を通過する緩やかなALMA。
空気信号:速速ALMAの下を通過し,交差量フィルタが有効である.
平空信号:高速ALMAの上でゆっくりとしたALMAを穿越する.
この戦略はシンプルで直感的で,同時にトレンド判断,ブレイクキャプチャー,取引量検証などの複数の技術指標を融合させ,比較的安定した取引システムを形成する.快速平均線の組み合わせは,トレンドの方向を効果的に判断する.ALMAアルゴリズムの適用は,遅れの取引への影響を軽減し,取引量への追加は,多くの不確実な偽のブレイクを回避する.
伝統的な均線交差策と比較して,この戦略は以下の利点があります.
ALMAのアルゴリズムは,遅延を軽減し,信号の質を向上させる.
交付量フィルタリングは,偽突破による損失を防ぐことができます.
平均線は大きなトレンドを判断し,逆転を避けるために配合されます.
規則はシンプルで直感的で,理解しやすく実行されます.
平均線パラメータを柔軟に調整し,異なる市場に適用する.
資金管理の設定は合理的で,単一損失を制御できます.
平均線パラメータを最適化することで,戦略の効果をさらに高めることができる.
一般的に,従来の均等交付戦略と比較して,この戦略は安定性と信号品質の改善を図っている.
この戦略には多くの利点がありますが,以下のリスクがあります.
平均線戦略は,本質的に,多発的な損失を生む,波動的な市場の混乱に弱い.
ALMAアルゴリズムのパラメータ設定は,戦略の効果に影響する.
取引量増幅効果は,取引信号判断を誤導する可能性がある.
しかし,この問題については,多くの場合,解決できない.
パラメトリックの最適化には過適合のリスクがある.
交付量異常の場合,信号は失効する.
機械学習などのアルゴリズムは,よりよい結果が得られるかもしれません.
利回り比率に注目し,曲線が太くならないように注意してください.
上記のリスク要因を考慮して,この戦略は以下の点で最適化できます.
ALMA平均線パラメータを最適化し,反応感度を高めること.
取引量を計算する方法を試してください.
ストップ・ロスの戦略を導入し,単一損失を厳しく管理する.
他の指標構成と結合して,体化取引信号システムを構築する.
機械学習モジュールを追加し,よりスマートな信号調整を実現します.
複数の品種を展開し,分散化戦略を講じます.
資金管理戦略を最適化し,異なる市場に応じてポジションを調整する.
戦略的な健常性研究,過適合防止
この戦略は,全体的に,従来の均線交差戦略と比較して,ALMAアルゴリズムと取引量検証により信号の質と安定性を向上させています.しかし,取引戦略の最適化は,リスクに注意し,多次元から戦略の強化を行い,より複雑な市場環境に対応できるようにする必要があります.
/*backtest
start: 2022-09-16 00:00:00
end: 2023-09-22 00:00:00
period: 1d
basePeriod: 1h
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/
// © Sarahann999
// Calculations for TP/SL based off: https://kodify.net/tradingview/orders/percentage-profit/
//@version=5
strategy("ALMA Cross", overlay=true)
//User Inputs
src= (close)
long_entry = input(true, title='Long Entry')
short_entry = input(true, title='Short Entry')
//Fast Settings
ALMA1 = input(100, "ALMA Lenghth 1", group= "ALMA Fast Length Settings")
alma_offset = input.float(defval=0.85, title='Arnaud Legoux (ALMA) - Offset Value', minval=0, step=0.01)
alma_sigma = input.int(defval=6, title='Arnaud Legoux (ALMA) - Sigma Value', minval=0)
Alma1 = ta.alma(src, ALMA1, alma_offset, alma_sigma)
//Slow Settings
ALMA2 = input(120, "ALMA Length 2", group = "ALMA Slow Length Settings")
alma_offset2 = input.float(defval=0.85, title='Arnaud Legoux (ALMA) - Offset Value', minval=0, step=0.01)
alma_sigma2 = input.int(defval=6, title='Arnaud Legoux (ALMA) - Sigma Value', minval=0)
Alma2 = ta.alma(src, ALMA2, alma_offset2, alma_sigma2)
//Volume
var cumVol = 0.
cumVol += nz(volume)
if barstate.islast and cumVol == 0
runtime.error("No volume is provided by the data vendor.")
shortlen = input.int(5, minval=1, title = "Short Length", group= "Volume Settings")
longlen = input.int(10, minval=1, title = "Long Length")
short = ta.ema(volume, shortlen)
long = ta.ema(volume, longlen)
osc = 100 * (short - long) / long
//Define Cross Conditions
buy = ta.crossover(Alma1, Alma2)
sell = ta.crossunder(Alma1, Alma2)
//Calculate Take Profit Percentage
longProfitPerc = input.float(title="Long Take Profit", group='Take Profit Percentage',
minval=0.0, step=0.1, defval=2) / 100
shortProfitPerc = input.float(title="Short Take Profit",
minval=0.0, step=0.1, defval=2) / 100
// Figure out take profit price 1
longExitPrice = strategy.position_avg_price * (1 + longProfitPerc)
shortExitPrice = strategy.position_avg_price * (1 - shortProfitPerc)
// Make inputs that set the stop % 1
longStopPerc = input.float(title="Long Stop Loss", group='Stop Percentage',
minval=0.0, step=0.1, defval=2.5) / 100
shortStopPerc = input.float(title="Short Stop Loss",
minval=0.0, step=0.1, defval=2.5) / 100
// Figure Out Stop Price
longStopPrice = strategy.position_avg_price * (1 - longStopPerc)
shortStopPrice = strategy.position_avg_price * (1 + shortStopPerc)
//Define Conditions
buySignal = buy and osc > 0
and strategy.position_size == 0
//sellSignal
sellSignal = sell and osc > 0
and strategy.position_size == 0
// Submit entry orders
if buySignal and long_entry
strategy.entry(id="Long", direction=strategy.long, alert_message="Enter Long")
alert(message="BUY Trade Entry Alert", freq=alert.freq_once_per_bar)
if sellSignal and short_entry
strategy.entry(id="Short", direction=strategy.short, alert_message="Enter Short")
alert(message="SELL Trade Entry Alert", freq=alert.freq_once_per_bar)
// Submit exit orders based on take profit price
if (strategy.position_size > 0)
strategy.exit(id="Long TP/SL", limit=longExitPrice, stop=longStopPrice, alert_message="Long Exit 1 at {{close}}")
if (strategy.position_size < 0)
strategy.exit(id="Short TP/SL", limit=shortExitPrice, stop=shortStopPrice, alert_message="Short Exit 1 at {{close}}")
//Draw
plot(Alma1,"Alma Fast", color=color.purple, style=plot.style_circles)
plot(Alma2,"Alma Slow", color=#acb5c2, style=plot.style_circles)