イチモク お金管理の短期戦略

作者: リン・ハーンチャオチャン,日付: 2023年12月28日 12:12:51
タグ:

img

概要

この戦略は,イチモク取引システムに基づいた改良である.主なアイデアは,イチモク指標とマネーマネジメントルールを組み合わせて,短期および長期取引機会を特定することです.

戦略の原則

この戦略は,古典的なイチモクシステムを基本基準として使用している.主な構成要素には以下の通りがある:

テンカン・セン: 転換線 中期トレンドを反映する

(キジュン・セン) ベースラインは 長期的な傾向を反映しています

センコウ・スパン: リーダーライン 将来のトレンドを反映する

チコウ・スパンは過去を反映した

この戦略は,以下のような改善を図っています.

  1. 時間パラメータは 市場パターンに合わせて 奇数方程式理論に従う

  2. ストップ・ロスト,テイク・プロフィート,ポジションサイズなどを含むマネーマネジメントのルールを追加し,取引リスクを制御します.

  3. バックテスト期間は,より包括的なテストのために調整できます.

具体的には,ロングエントリー条件には,テンカンクロスキジュンが上,チコウが価格の上,価格がクモの上,将来のクモが上昇などが含まれます.ショートエントリーにはテンカンクロスキジュンがダウン,チコウが価格の下などが必要です.

マネーマネジメントのルールは,ロングで30%の利益と5%のストップロスを要求し,ショートで3ATR以上のストップロスを要求する.

利点分析

イチモクとマネーマネジメントを組み合わせる主な利点は:

  1. イチモク自身は 短期中長期の傾向を反映し 合理的な入口/出口です

  2. 市場統計と一致するパラメータを最適化します

  3. マネーマネジメントは,利益が増加する一方,単一の取引ストップ損失を効果的に制御します.

  4. 調整可能なバックテスト期間により,より包括的なテストが可能になります.

概要すると,この戦略は,トレンド,パラメータ選択,リスク管理等を包括的に考慮し,短期間の機会を特定し,取引リスクを制御するのに有効であり,非常に実用的です.

リスク分析

この戦略の主なリスクは以下のものです.

  1. イチモクは偽の侵入に 傾向があるので フィルターが必要だ

  2. 固定利益とストップロスは 罠に晒されやすい ダイナミックなルールが必要です

  3. バックテストのデータが不完全である場合,パフォーマンスは過大評価される可能性があります.より多くの市場でより長いテストが必要です.

  4. 戦略は傾向市場により適している. 範囲の市場では劣る可能性があります. トレンド識別のためにエントリー条件を最適化することができます.

改善の方向性

改善すべき主な分野は以下の通りである.

  1. 入力品質を改善するために指標フィルターを追加します.MACD,KDJなど.

  2. ダイナミック・プロフィート・テイクとストップ・ロスは,例えば,N ATRのブレイク後にプロフィート・テイク,サポートを下回るストップ・ロスは,

  3. 安定性を検証するために,より長いデータで複数の資産をテストする.

  4. 傾向と市場範囲を区別し,市場状況の変化に適応するためにエントリを最適化します.

結論

この戦略は,トレンド,マネーマネジメントなどを包括的に考慮し,長期の機会を特定するためにイチモクを使用し,単一の取引損失を制限するためにリスク管理ルールを適用する.元のイチモクシステムよりも著しい改善.さらなる最適化は,非常に実用的な短期戦略を潜在的にすることができます.


/*backtest
start: 2023-11-27 00:00:00
end: 2023-12-27 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// Author Obarut
//@version=5
strategy("İchimoku Strategy With MM Short-Long",overlay=true,process_orders_on_close=true)

//Ichimoku Inputs
ts_period = input.int(8, minval=1, title="Tenkan-Sen Period")
ks_period = input.int(16, minval=1, title="Kijun-Sen Period")
ssb_period = input.int(24, minval=1, title="Senkou-Span B Period")
cs_offset = input.int(16, minval=1, title="Chikou-Span Offset")
ss_offset = input.int(8, minval=1, title="Senkou-Span Offset")
long_entry = input(true, title="Long Entry")
short_entry = input(true, title="Short Entry")

// Back Testing Period Inputs

fromday = input.int(defval=1,title="Start Date",minval=1,maxval=31) 
frommonth = input.int(defval=1,title="Start Month",minval=1,maxval=12)
fromyear = input.int(defval=1980,title="Start Year",minval=1800, maxval=2100)
today = input.int(defval=1,title="En Date",minval=1,maxval=31)
tomonth = input.int(defval=1,title="End Month",minval=1,maxval=12)
toyear =input.int(defval=2100,title="End Year",minval=1800,maxval=2200)
start=timestamp(fromyear,frommonth,fromday,00,00)
finish=timestamp(toyear,tomonth,today,00,00)
timewindow= time>=start and time<=finish

//Ichimoku Componenets Calculation Function
middle(len) => math.avg(ta.lowest(len), ta.highest(len))

// Ichimoku Components

tenkan = middle(ts_period)
kijun = middle(ks_period)
senkouA = math.avg(tenkan, kijun)
senkouB = middle(ssb_period)
//Senkou Span Lines slopes
slopetenkan=(tenkan-tenkan[2])/tenkan
slopekijun= (kijun-kijun[2])/kijun
//Avarage True Range 
atr = ta.atr(14)
//Senkou Span Lines
ss_above = math.max(senkouA[ss_offset-1], senkouB[ss_offset-1])
ss_below = math.min(senkouA[ss_offset-1], senkouB[ss_offset-1])

// Price Distance From Tenkan
distance = close - tenkan

// Price Distance from Kijun
distancek = close - kijun

// Entry/Exit Signals

tk_cross_kijun_bull = tenkan >= kijun//Tenkan Sen is greater than or equal to  Kijun Sen
tk_cross_kijun_bear = tenkan <= kijun//Tenkan Sen is smaller than or equal to Kijun Sen
cs_cross_bull = close > high[cs_offset-1]//Chikou is above the price
cs_cross_bear = close < close[cs_offset-1]//Chikou is below the price
price_above_kumo = close > ss_above//Price is above the Kumo cloud
pbsenkA = close < ss_above // Price is below the Senkou Span which is higher
pasenkB = close > ss_below// Price is above the Senkou span which is lower
price_below_kumo = close < ss_below // Price is below Kumo cloud
future_kumo_bull = senkouA > senkouB and (ta.roc(senkouA,3)>0) and (ta.roc(senkouB,3)>=0) // Future Kumo cloud is bullish
pbtenkan=close<tenkan
tkbelowkij=tenkan<kijun
future_kumo_bear = senkouA < senkouB//Future Kumo cloud is bearish
// Price Distance From Tenken
disbull = distance < 2*atr
//Price Distance From Kijun
disbullk = distancek < 3*atr
//Price Above Tenkan Condition
patk = close > tenkan
// Kijun Above Senkou Span Condition
kjasenkA = kijun > ss_above
// Price Below Kijun Condition
pbkijun = close < kijun
//Consolidation Tenkan and Kijun are inside Kumo cloud
kijuninsidekumo= kijun<ss_above and kijun>ss_below
tenkaninsidekumo= tenkan<ss_above and tenkan>ss_below
consolidation=kijuninsidekumo and tenkaninsidekumo

//Bullish Entry Condition

bullish= tk_cross_kijun_bull and cs_cross_bull and price_above_kumo and future_kumo_bull and disbull and patk 
     and not consolidation
//Bullish exit
bearish=tk_cross_kijun_bear and pbsenkA and cs_cross_bear  and future_kumo_bear
      or price_below_kumo     
// Bearish Entry Condition

bearish2=tk_cross_kijun_bear and pbtenkan and tkbelowkij and tkbelowkij and cs_cross_bear and future_kumo_bear

if(bullish and timewindow and long_entry )
    strategy.entry("Long Entry", strategy.long)


if(bearish2 and timewindow and short_entry)
    strategy.entry("Short Entry",strategy.short)
// Bearish Condition



lastentryprice = strategy.opentrades.entry_price(strategy.opentrades - 1)

// Take Profit or Stop Loss in Bearish

exit1= (close-tenkan)>3*atr and slopetenkan<=0
exit2= (close-lastentryprice)>5*atr and close<(tenkan-0.04*atr)

if(bearish and timewindow and not short_entry or exit1 or exit2  or (close>1.30*lastentryprice  ) or (close< 0.95*lastentryprice))
    strategy.close("Long Entry")
if(bullish and timewindow and not long_entry)
    strategy.close("Short Entry")
if(time>finish)
    strategy.close_all("time up")

plot(tenkan, color=#0496ff, title="Tenkan-Sen")
plot(kijun, color=#991515, title="Kijun-Sen")
plot(close, offset=-cs_offset+1, color=#2e640e, title="Chikou-Span")
sa=plot(senkouA, offset=ss_offset-1, color=color.rgb(17, 122, 21), title="Senkou-Span A")
sb=plot(senkouB, offset=ss_offset-1, color=color.rgb(88, 8, 8), title="Senkou-Span B")
fill(sa, sb, color = senkouA > senkouB ? color.rgb(198, 234, 198) : color.rgb(208, 153, 153), title="Cloud color")

もっと