This strategy combines Ichimoku and MACD indicators, entering trades after confirming trend reversal. It belongs to trend reversal trading strategies.
Calculate Ichimoku Tenkan line to gauge trend direction. Price above it indicates uptrend, and below downtrend.
MACD death cross generates sell signal in uptrend; golden cross buy signal in downtrend.
Combine Ichimoku trend bias and MACD reversal signals to trade trend reversals.
Option to set trading hour control, like no trading at night or weekends, to avoid risks associated with certain times.
Employ proper stop loss and take profit for profit locking and risk control.
Ichimoku intuitively displays trends and support/resistance levels.
MACD sensitively captures trend reversals.
Combining trend bias and reversal improves signal quality.
Customizable trading hours avoid risks around major news events.
Stop loss and take profit effectively manages capital risks.
Ichimoku and MACD may generate false signals.
Reversal strength unknown, risks of chasing tops and bottoms.
Trading hour control may miss some opportunities.
Improper stop loss and take profit settings lead to premature exit.
Parameter optimization may lead to overfitting.
Test Ichimoku and MACD parameters for optimal combinations.
Add other indicators to confirm trading signals.
Optimize stops and profits to balance risks and returns.
Evaluate necessity of trading hour control and relax if appropriate.
Incorporate trend filter to avoid losses from reversal trades.
Research ways to gauge reversal strength and potential pullback height.
This strategy combines Ichimoku’s trend bias and MACD’s reversal signals to trade after trend reversals. Further optimization and enhancements can reduce signal errors and improve stability and efficiency as a robust trend reversal system.
/*backtest start: 2022-09-13 00:00:00 end: 2023-09-19 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © Revazi //@version=5 strategy("The Impeccable by zyberal", overlay = true) // Inputs { // Strategy variables IchimokuTenkanPeriod = input(9) IchimokuKijunPeriod = input(190) IchimokuSenkouPeriod = input(52) MACDMainFast = input(3) MACDMainSlow = input(10) MACDMainSmooth = input(9) ExitAfterBars = input(2) ProfitTarget = input(135) StopLoss = input(70) // Trading Options DontTradeOnWeekends = input(true) ExitAtEndOfDay = input(true) DayExitTimeHour = input(23) DayExitTimeMinute = input(04) ExitOnFriday = input(true) FridayExitTimeHour = input(20) FridayExitTimeMinute = input(40) // } // TRADING OPTIONS LOGIC { OpenOrdersAllowed = true // Dont trade on weekends { if DontTradeOnWeekends if dayofweek == dayofweek.saturday or dayofweek == dayofweek.sunday OpenOrdersAllowed := false // } // Exit on close (end of day) { if ExitAtEndOfDay if timeframe.isintraday and time >= timestamp(year(timenow), month(timenow), dayofmonth(timenow), DayExitTimeHour, DayExitTimeMinute) OpenOrdersAllowed := false // } // Exit on Friday { if ExitOnFriday if timeframe.isintraday and time >= timestamp(year(timenow), month(timenow), dayofmonth(timenow), FridayExitTimeHour, FridayExitTimeMinute) OpenOrdersAllowed := false // } // Rule: Trading signals { openW3 = request.security(syminfo.tickerid, "W", open)[3] middleDonchian(Length) => math.avg(ta.highest(Length), ta.lowest(Length)) Tenkan = middleDonchian(IchimokuTenkanPeriod)[2] [macdLine, signalLine, _] = ta.macd(close, MACDMainFast, MACDMainSlow, MACDMainSmooth) LongEntrySignal = openW3 > Tenkan and ta.crossunder(macdLine, signalLine)[3] //macdLine[3] < signalLine[3] ShortEntrySignal = openW3 < Tenkan and ta.crossover(macdLine, signalLine)[3] //macdLine[3] > signalLine[3] // } // Calculate conditions { IsFlat() => strategy.position_size == 0 IsLong() => strategy.position_size > 0 IsShort() => strategy.position_size < 0 longCondition = OpenOrdersAllowed and not IsLong() and LongEntrySignal shortCondition = OpenOrdersAllowed and not IsShort() and ShortEntrySignal // } // Open positions based on conditions { strategy.order(id = "buy", direction = strategy.long, qty = 1, when = longCondition) strategy.order(id = "sell", direction = strategy.short, qty = 1, when = shortCondition) // }