ハイケン・アシとイチモク・キンコ・ヒョー 取引戦略

作者: リン・ハーンチャオチャン, 日付: 2023-09-18 15:13:35
タグ:

概要

この戦略は,トレンド方向を決定し,トレンドをフォローするためにハイケンアシとイチモク・キンコ・ヒョー指標を組み合わせます.ハイケンアシのスムージングはノイズを減らす.イチモクはトレンド強さを評価するために変換とベースラインなどの複数の信号を使用します.この組み合わせは戦略の安定性を向上させます.

戦略の論理

ハイケン・アシの閉店価格を計算し,変換線,ベースラインなどイチモク指標をプロットする. 閉店が前2日よりも高く,イチモク上位エッジと遅延線よりも高くなった場合,ロングに行く. 閉店が前2日よりも低く,イチモク下位エッジと遅延線よりも低い場合,ショートに行く. 変換とベースラインの交差も二次信号を提供します.

利点

  • ハイケン・アシは 信号の質を向上させる 偽のブレイクをフィルターします
  • イチモクは複数の検証信号を使用します
  • 遅れたラインは,利益を得ることを保証するウィップソウを避けます
  • この傾向に従うと 持有期間が長くなり 利益も上がります

リスク

  • ハイケン・アシの滑らかさは完璧に最適化できない
  • イチモクパラメータは結果に大きく影響します
  • 長期保有リスク 損失増加
  • 低取引頻度は短期に適さない

リスクは滑らかさ,保持期間,イチモクパラメータの最適化などによって制御できます

改良

  • 異なるヘイケンアシの滑らかなパラメータをテスト
  • イチモク周期パラメータを最適化
  • 出国後に再入国規則を策定する
  • 異なる製品における耐久性試験

結論

この戦略は,制御された引き下げでトレンド方向を決定するために,複数の指標を包括的に使用します.調整パラメータなどによってパフォーマンスをさらに改善することができます.


/*backtest
start: 2023-08-18 00:00:00
end: 2023-09-17 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3

strategy("Heiken Ashi + Ichimoku Kinko Hyo Strategy", shorttitle="HaI", overlay=true, default_qty_type=strategy.percent_of_equity, max_bars_back=1000, default_qty_value=100, calc_on_order_fills= true, calc_on_every_tick=true, pyramiding=0)

hahigh = security(heikinashi(syminfo.tickerid), timeframe.period, high)
halow = security(heikinashi(syminfo.tickerid), timeframe.period, low)

TenkanSenPeriods = input(9, minval=1, title="Tenkan Sen Periods")
KijunSenPeriods = input(24, minval=1, title="Kijun Sen Periods")
SenkouSpanBPeriods = input(51, minval=1, title="Senkou Span B Periods")
displacement = input(24, minval=1, title="Displacement")
donchian(len) => avg(lowest(len), highest(len))
TenkanSen = donchian(TenkanSenPeriods)
KijunSen = donchian(KijunSenPeriods)
SenkouSpanA = avg(TenkanSen, KijunSen)
SenkouSpanB = donchian(SenkouSpanBPeriods)
SenkouSpanH = max(SenkouSpanA[displacement - 1], SenkouSpanB[displacement - 1])
SenkouSpanL = min(SenkouSpanA[displacement - 1], SenkouSpanB[displacement - 1])
ChikouSpan = close[displacement-1]

plot(TenkanSen, color=blue, title="Tenkan Sen", linewidth = 2)
plot(KijunSen, color=maroon, title="Kijun Sen", linewidth = 3)
plot(close, offset = -displacement, color=orange, title="Chikou Span", linewidth = 2)
sa=plot (SenkouSpanA, offset = displacement, color=green,  title="Senkou Span A", linewidth = 2)
sb=plot (SenkouSpanB, offset = displacement, color=red,  title="Senkou Span B", linewidth = 3)
fill(sa, sb, color = SenkouSpanA > SenkouSpanB ? green : red)

longCondition = hahigh > max(hahigh[1],hahigh[2]) and close>ChikouSpan and close>SenkouSpanH and (TenkanSen>=KijunSen or close>KijunSen)
if (longCondition)
    strategy.entry("Long",strategy.long)

shortCondition = halow < min(halow[1],halow[2]) and close<ChikouSpan and close<SenkouSpanL and (TenkanSen<=KijunSen or close<KijunSen)
if (shortCondition)
    strategy.entry("Short",strategy.short)

closelong = halow < min(halow[1],halow[2]) and (TenkanSen<KijunSen or close<TenkanSen or close<KijunSen or close<SenkouSpanH or close<ChikouSpan)
if (closelong)
    strategy.close("Long")

closeshort = hahigh > max(hahigh[1],hahigh[2]) and (TenkanSen>KijunSen or close>TenkanSen or close>KijunSen or close>SenkouSpanL or close>ChikouSpan)
if (closeshort)
    strategy.close("Short")

もっと