イチモク・クラウド・量子戦略

作者: リン・ハーンチャオチャン開催日:2023年11月24日 10:15:15
タグ:

img

概要

この戦略は,K線パターン,移動平均値,ストカスティックRSI指標と組み合わせて,イチモク指標を通じてトレンド方向を判断し,トレンドが上昇するときによりよいエントリーポイントでシグナルをフィルターし,ロングに行く.

戦略原則

戦略の主な判断基準は以下の通りである.

  1. イチモク・リードライン1がリードライン2を横切って 上昇傾向を示しています
  2. K線閉値がリードライン1を横断し,トレンドに従う条件を満たす.
  3. K線は緑のろうそくで トレンドは上がる
  4. 移動平均値が有効になっている場合,速いMAは遅いMAを横切る.
  5. ストカスティックRSIが有効になったとき,%K線が%D線の上を横切ります.

上記の条件がすべて同時に満たされた場合,戦略はロングポジションを開く.価格がリードライン1を下回ると,戦略はポジションを閉じます.

この戦略は主にイチモク雲を使用して 主なトレンド方向を決定し,補助指標と組み合わせて信号をフィルタリングし,トレンドが上昇するときにより良いポイントでロングに行く.

戦略 の 利点

  1. イチモク雲を使って主要トレンドを決定します バックテストは高い精度を示しています
  2. 利潤率を大幅に向上させる
  3. 長期戦略のみで,牛市であると判断される通貨に適しています.
  4. パラメータ最適化のための大きなスペース,さらなる最適化のために指標パラメータを調整することができます

戦略 の リスク

  1. イチモク雲がトレンドを誤って判断する確率は
  2. ストップ・ロスは急激な市場の変化によって破られ,損失が増加する可能性があります.
  3. 高騰市場のために設計され,トレンド逆転の隠れた兆候のある通貨には適さない.
  4. パラメータの設定が正しくない場合,過度に攻撃的なエントリや過度に保守的なアクションが発生する可能性があります.

対策:

  1. 傾向を判断するためにより多くの指標を組み合わせ,正確性を向上させる
  2. 単一の損失を厳格に制御するために,合理的なストップ損失点を設定する
  3. 異なる通貨の市場状況に応じて適切な戦略を選択する
  4. 戦略をより安定させるため,パラメータを慎重にテストし最適化します

戦略の最適化のための方向性

  1. 安定性をさらに向上させるために補助指標のパラメータ設定を最適化
  2. ストップ・ロスのメカニズムを追加します.例えば,ストップ・ロスの後退,指数移動平均ストップ・ロスの後退など.
  3. 固定ポジションサイズ,ポジション平均等を追加します
  4. 特定の通貨のためのパラメータ調整と最適化を行います.

概要

このイチモククラウド量子戦略は,トレンド方向を判断することで,高い勝利率を達成し,リスク制御可能な唯一の長期戦略を達成する.戦略の利点は明らかであり,牛市で優れたパフォーマンスを示しています.次のステップは,指標最適化,ストップ損失メカニズム,ポジション管理などの側面を向上させ,戦略をより包括的で安定させることです.


/*backtest
start: 2022-11-17 00:00:00
end: 2023-11-23 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4

strategy(title="Ichimoku only Long Strategy", shorttitle="Ichimoku only Long", overlay = true, pyramiding = 0, calc_on_order_fills = false, commission_type =  strategy.commission.percent, commission_value = 0, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, initial_capital=10000, currency=currency.USD)

// Time Range
FromMonth=input(defval=1,title="FromMonth",minval=1,maxval=12)
FromDay=input(defval=1,title="FromDay",minval=1,maxval=31)
FromYear=input(defval=2017,title="FromYear",minval=2017)
ToMonth=input(defval=1,title="ToMonth",minval=1,maxval=12)
ToDay=input(defval=1,title="ToDay",minval=1,maxval=31)
ToYear=input(defval=9999,title="ToYear",minval=2017)
start=timestamp(FromYear,FromMonth,FromDay,00,00)
finish=timestamp(ToYear,ToMonth,ToDay,23,59)
window()=>true
// See if this bar's time happened on/after start date
afterStartDate = time >= start and time<=finish?true:false

//Enable RSI
enableema = input(true, title="Enable EMA?")
enablestochrsi = input(false, title="Enable Stochastik RSI?")

//EMA
emasrc = close, 
len1 = input(24, minval=1, title="EMA 1")
len2 = input(90, minval=1, title="EMA 2")

ema1 = ema(emasrc, len1)
ema2 = ema(emasrc, len2)

col1 = color.lime
col2 = color.red

//EMA Plots
plot(ema1, title="EMA 1", linewidth=1, color=col1)
plot(ema2, title="EMA 2", linewidth=1, color=col2)

//STOCH RSI
smoothK = input(3, minval=1, title="RSI K Line")
smoothD = input(3, minval=1, title="RSI D Line")
lengthRSI = input(14, minval=1, title="RSI Length")
lengthStoch = input(14, minval=1, title="Stochastik Length")
src = input(close, title="RSI Source")

rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)

//Ichimoku
conversionPeriods = input(9, minval=1, title="Ichi Conversion Line Length")
basePeriods = input(26, minval=1, title="Ichi Base Line Length")
laggingSpan2Periods = input(52, minval=1, title="Ichi Lagging Span 2 Length")
displacement = input(1, minval=0, title="Ichi Displacement")
donchian(len) => avg(lowest(len), highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
p1 = plot(leadLine1, offset = displacement - 1, color=color.green,
	 title="Lead 1")
p2 = plot(leadLine2, offset = displacement - 1, color=color.red,
	 title="Lead 2")
fill(p1, p2, color = leadLine1 > leadLine2 ? color.green : color.red)


//Long Condition
crossup = k[0] > d[0] and k[1] <= d[1]
ichigreenabovered = leadLine1 > leadLine2
ichimokulong = close > leadLine1
greencandle =  close > open
redcandle = close < open
emacond = ema1 > ema2
longcondition = ichigreenabovered and ichimokulong and greencandle

//Exit Condition
ichimokuexit = close < leadLine1

exitcondition = ichimokuexit and redcandle

//Entrys

if (enablestochrsi == false) and (enableema == false) and (longcondition) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)
    
if (enablestochrsi == true) and (enableema == false) and (longcondition) and (crossup) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)

if (enableema == true) and (enablestochrsi == false) and (longcondition) and (emacond) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)

if (enableema == true) and (enablestochrsi == true) and (longcondition) and (emacond) and (crossup) and (afterStartDate) and (strategy.opentrades < 1)
    strategy.entry("Long", strategy.long)


//Exits
if (afterStartDate)
    strategy.close(id = "Long", when = exitcondition)









もっと