
Heikin Ashi HighLowチャネルダイナミック均線取引戦略は,Heikin Ashi線閉盤価格とダイナミック均線を比較して取引シグナルを生成する戦略である.この戦略は,双均線を用いてチャネルを形成し,線閉盤価格突破チャネル上下軌道に基づいて買入と販売を行う.
この戦略は,Heikin Ashi線技術指標に基づいている。Heikin Ashi線は,市場騒音をフィルターして,トレンドを識別する。この戦略は,高点形成のlenh周期平均線を通道上線として,低点形成のlenl周期平均線を通道下線として使用する。Heikin Ashi線は,閉盘価格の上線を突破すると,買入シグナルを生成し,Heikin Ashi線は,閉盘価格下線を突破すると,売り出シグナルを生成する。
具体的には,戦略は,最初に高低点のそれぞれの単純移動平均を計算してチャネルを構築する.高点の移動平均mahはチャネル上軌道,低点の移動平均malはチャネル下軌道である.それから,Heikin Ashi線の閉盘価格とチャネル上軌道下軌道を比較して取引シグナルを生成する.線の閉盘価格が上軌道mahより高い場合は,買入シグナルをLongConditionで生成し,線の閉盘価格が下軌道malより低い場合は,売り出シグナルをShortConditionで生成する.
リスクに応じて,ストップ・ロスの仕組みを設定するか,または他の指標と組み合わせて突破信号を確認し,誤った信号が不要な損失を引き起こすのを避ける.
Heikin Ashi HighLowチャネルダイナミック・均線取引戦略は,全体的に論理的に明確で,操作が簡単である.この戦略は,Heikin Ashiの線技術の優位性を充分活用してトレンドを識別し,双均線ダイナミック・チャネル判断を支える抵抗を設定する.パラメータを最適化,信号フィルタリング機構を追加し,ストップ・ローズ戦略を設定するなど,この戦略をさらに完善し,取引リスクを減らすことができる.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © shiner_trading
// [email protected]
//@version=4
strategy("Hi-Lo Channel Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, initial_capital=500, default_qty_value=100, currency="USD")
lenh = input(5, "High-Based MA")
lenl = input (5, "Low-Based MA")
ha = input(true, "Use Heikin Ashi OHCL values (on real chart)?")
ha_h = security(heikinashi(syminfo.tickerid), timeframe.period, high)
ha_l = security(heikinashi(syminfo.tickerid), timeframe.period, low)
ha_c = security(heikinashi(syminfo.tickerid), timeframe.period, close)
float mah = na
float mal = na
longCondition = false
shortCondition = false
/// HA is the check mark box in the configuration.
/// IF "Use Heikin Ashi OHCL values?" is true, then the strategy will use the Heikin Ashi close values
// and therefore give the same buy/sell signals regardless of what chart you are viewing.
/// That being said, if "Use Heikin Ashi OHCL values?" is FALSE, yet you are viewing Heikin Ashi candles on your chart,
// then logically you will also get the same buy/sell signals
if ha == true
mah := sma(ha_h, lenh)
mal := sma(ha_l, lenl)
longCondition := ha_c > mah
shortCondition := ha_c < mal
if ha == false
mah := sma(high, lenh)
mal := sma(low, lenl)
longCondition := close > mah
shortCondition := close < mal
plot(mah, color=color.green)
plot(mal, color=color.red)
if (longCondition)
strategy.entry("Buy", 100)
if (shortCondition)
strategy.close("Buy")