
La stratégie d’équilibrage du premier œil est une stratégie de suivi de la tendance réalisée à l’aide de l’indicateur Ichimoku Kinko Hyo. Cette stratégie combine plusieurs indicateurs pour identifier la direction de la tendance, faire plus dans le marché haussier, faire moins dans le marché baissier et réaliser une valeur ajoutée à long terme du capital.
La stratégie est basée sur l’indicateur Ichimoku Kinko Hyo. Il est composé de la ligne de virage (((Tenkan-Sen), de la ligne de référence (((Kijun-Sen), de la ligne de front (((Senkou-Span A), de la ligne de tête (((Senkou-Span B) et de la ligne de retard (((Chikou-Span).
Les signaux de trading de cette stratégie proviennent d’une combinaison des conditions suivantes:
Lorsque les conditions ci-dessus sont réunies, il y a une entrée multiple. Lorsque les conditions ci-dessus sont réunies, il y a une entrée vide.
Cette stratégie, combinée au suivi des tendances et à l’indicateur de survente, permet d’identifier efficacement la direction de la tendance. Les principaux avantages sont les suivants:
Cette stratégie comporte également des risques à prendre en compte:
La réponse:
Cette stratégie peut être optimisée dans les directions suivantes:
La stratégie d’équilibrage à première vue est une stratégie de suivi de tendance fiable et robuste. Elle résout des problèmes importants dans le trading de tendance. L’équilibre entre l’exactitude de l’identification de la tendance et la fréquence de production de trades.
/*backtest
start: 2023-11-16 00:00:00
end: 2023-11-20 08:00:00
period: 3m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("Ichimoku Kinko Hyo: ETH 3h Strategy by tobuno", overlay=true)
//Inputs
ts_bars = input(22, minval=1, title="Tenkan-Sen Bars")
ks_bars = input(60, minval=1, title="Kijun-Sen Bars")
ssb_bars = input(120, minval=1, title="Senkou-Span B Bars")
cs_offset = input(30, minval=1, title="Chikou-Span Offset")
ss_offset = input(30, minval=1, title="Senkou-Span Offset")
long_entry = input(true, title="Long Entry")
short_entry = input(true, title="Short Entry")
//Volatility
vollength = input(defval=2, title="VolLength")
voltarget = input(defval=0.2, type=float, step=0.1, title="Volatility Target")
Difference = abs((close - open)/((close + open)/2) * 100)
MovingAverage = sma(Difference, vollength)
highvolatility = MovingAverage > voltarget
////////////////////////////////////////////////////////////////////////////////
// BACKTESTING RANGE
// From Date Inputs
fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
fromYear = input(defval = 2019, title = "From Year", minval = 1970)
// To Date Inputs
toDay = input(defval = 31, title = "To Day", minval = 1, maxval = 31)
toMonth = input(defval = 12, title = "To Month", minval = 1, maxval = 12)
toYear = input(defval = 2020, title = "To Year", minval = 1970)
// Calculate start/end date and time condition
startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)
finishDate = timestamp(toYear, toMonth, toDay, 00, 00)
time_cond = true
////////////////////////////////////////////////////////////////////////////////
middle(len) => avg(lowest(len), highest(len))
// Ichimoku Components
tenkan = middle(ts_bars)
kijun = middle(ks_bars)
senkouA = avg(tenkan, kijun)
senkouB = middle(ssb_bars)
//RSI
change = change(close)
gain = change >= 0 ? change : 0.0
loss = change < 0 ? (-1) * change : 0.0
avgGain = rma(gain, 14)
avgLoss = rma(loss, 14)
rs = avgGain / avgLoss
rsi = 100 - (100 / (1 + rs))
// Plot Ichimoku Kinko Hyo
plot(tenkan, color=#0496ff, title="Tenkan-Sen")
plot(kijun, color=#991515, title="Kijun-Sen")
plot(close, offset=-cs_offset+1, color=#459915, title="Chikou-Span")
sa=plot(senkouA, offset=ss_offset-1, color=green, title="Senkou-Span A")
sb=plot(senkouB, offset=ss_offset-1, color=red, title="Senkou-Span B")
fill(sa, sb, color = senkouA > senkouB ? green : red, title="Cloud color")
ss_high = max(senkouA[ss_offset-1], senkouB[ss_offset-1])
ss_low = min(senkouA[ss_offset-1], senkouB[ss_offset-1])
// Entry/Exit Signals
tk_cross_bull = tenkan > kijun
tk_cross_bear = tenkan < kijun
cs_cross_bull = mom(close, cs_offset-1) > 0
cs_cross_bear = mom(close, cs_offset-1) < 0
price_above_kumo = close > ss_high
price_below_kumo = close < ss_low
rsi_bullish = rsi > 50
rsi_bearish = rs < 50
bullish = tk_cross_bull and cs_cross_bull and price_above_kumo and rsi_bullish and highvolatility
bearish = tk_cross_bear and cs_cross_bear and price_below_kumo and rsi_bearish and highvolatility
strategy.entry("Long", strategy.long, when=bullish and long_entry and time_cond)
strategy.entry("Short", strategy.short, when=bearish and short_entry and time_cond)
strategy.close("Long", when=bearish and not short_entry and time_cond)
strategy.close("Short", when=bullish and not long_entry and time_cond)