Ichimoku 5 Rules Backtest — Strategy by Yesid_Correa_Cano

By Yesid_Correa_Cano

Performance Metrics

Description

ICHIMOKU 5/5 BACKTEST STRATEGYThis strategy is a rule-based, long-only backtesting framework designed specifically for the 1-hour timeframe.Its purpose is to evaluate the historical behavior of a five-condition Ichimoku-based setup under predefined risk, reward, and holding-time rules.The strategy does not attempt to predict future prices. It is designed to test whether a clearly defined technical setup produces repeatable historical outcomes across a sufficiently large sample of trades.HOW THE STRATEGY WORKSA potential long setup requires all five conditions to be simultaneously satisfied and confirmed.1. CHIKOU CONFIRMATIONCurrent price must be above the price from 26 bars ago.This condition is used as a historical price-structure confirmation.2. TENKAN / KIJUN STRUCTURETenkan-sen must be above Kijun-sen.This represents bullish short-term versus medium-term Ichimoku structure.3. MACD MOMENTUM STRUCTUREThe strategy evaluates bullish MACD and/or Signal Line divergence or convergence using confirmed price pivot lows.The pivot comparison can identify:- Lower Low in price with Higher Low in momentum- Higher Low in price with Higher Low in momentumThe MACD, Signal Line, or both can be selected through the strategy inputs.Because pivots require right-side confirmation bars, this condition only becomes available after the relevant pivot has been confirmed.4. KUMO BREAKOUT + PULLBACK CONDITIONPrice must be above the relevant Kumo reference after having traded below or inside the cloud during the selected historical lookback period.This condition is intended to identify a transition from weaker price structure into a confirmed position above the cloud.5. BULLISH KUMOSenkou Span A must be above Senkou Span B.This represents bullish future-cloud structure.ENTRY LOGICA trade is generated only when a NEW confirmed 5/5 setup appears.If all five conditions remain true for several consecutive bars, the strategy does not repeatedly generate additional entries.Pyramiding is disabled.The setup is confirmed using completed bars.Because process_orders_on_close is disabled, a confirmed signal is submitted after the signal bar closes and is normally filled according to TradingView's broker-emulator execution model on the following bar.DEFAULT CAPITAL AND POSITION SETTINGSInitial capital:USD 3,000Position size:10% of current equityPyramiding:0The strategy is intended to simulate relatively small position exposure while separating position size from the maximum intended capital risk.RISK MANAGEMENTDefault maximum intended risk per trade:1% of current equityDefault target:3.5RThe initial risk amount is calculated from current strategy equity.The stop distance is then derived from:Initial Risk Cash / Position SizeFor a long trade:Stop Price =Entry Price - Risk Per ShareTarget Price =Entry Price + (Risk Per Share × Reward/Risk Multiple)The default reward/risk multiple is 3.5R but can be modified through the strategy inputs.TRADING COSTSThe strategy uses a fixed commission of:USD 0.10 per executed orderUnder the normal one-entry / one-exit structure:Entry commission:USD 0.10Exit commission:USD 0.10Approximate total commission for a completed trade:USD 0.20The commission is fixed per order and does not vary with position value.The TRIM marker is visual only and therefore does not generate an additional order or commission.Slippage and bid/ask spread can vary substantially by instrument, liquidity, market conditions, and order type. They should be considered when interpreting historical results. Users should apply assumptions appropriate to the instrument being tested.MAXIMUM HOLDING TIMEDefault maximum holding period:15 trading sessionsDefault 1-hour bars per session:7Equivalent maximum:105 one-hour barsIf neither the stop nor the target has been reached by the maximum holding period, the position is closed using a TIME EXIT.Both values can be modified through the strategy inputs.TRIM REFERENCEThe strategy includes an optional TRIM marker intended to identify when price has completed a selected percentage of the theoretical Entry-to-Target distance.Default TRIM level:75%The percentage is configurable.For example, with a 3.5R target:75% × 3.5R = 2.625RTherefore, under the default parameters, the TRIM reference corresponds to approximately +2.625R from the entry.IMPORTANT:TRIM is a visual reference only.It does NOT:- reduce the position- execute a partial exit- modify the stop- change the profit target- affect strategy performance- generate additional commissionsTRIM GAP HANDLINGTwo different situations are considered.NORMAL PRICE MOVEMENTIf price trades normally through the calculated TRIM level, the TRIM label is placed at the theoretical TRIM price.GAP ABOVE TRIMIf the market opens above the calculated TRIM level, the label is placed at the opening price of that bar.This is intended to avoid visually marking an execution at a theoretical price that was skipped by the gap.The marker remains informational only.BACKTEST TABLEThe strategy includes an on-chart statistical table containing:- Closed Trades- Wins- Losses- Win Rate- Profit Factor- Expectancy- Net P&L- ROI- Maximum Drawdown- Average Holding Period- Target Exits- Stop Exits- Time Exits- Realized R Distribution- Mean R- Standard Deviation of RREALIZED R DISTRIBUTIONEach completed trade is measured relative to its initial planned risk.Realized R is calculated as:Trade Profit / Initial Risk CashFor visualization, outcomes are grouped into 0.5R distribution ranges.The distribution includes:= +3.5RThe distribution buckets are rounded for display purposes only.Mean R and Standard Deviation are calculated from the actual realized R values rather than from the rounded distribution buckets.EXPECTANCYMean R represents the average realized R-multiple produced by the completed trades in the historical sample.It is displayed as the strategy's historical expectancy per trade.A positive historical expectancy does not imply that future expectancy will remain positive.STANDARD DEVIATIONStandard Deviation measures the dispersion of individual realized R outcomes around the historical Mean R.It is included to provide additional context regarding the variability of strategy outcomes.The calculation does not assume that future returns will follow a normal distribution.SAMPLE SIZEThe strategy includes a visual sample-size classification.LOW:Fewer than 50 completed tradesPRELIM.:50 to 99 completed tradesVALID:100 or more completed tradesIMPORTANT:The term VALID refers only to the strategy's predefined minimum sample-size threshold.It does NOT mean that the strategy has been statistically validated, that its results are reliable in every market, or that future profitability is expected.Sample size should always be interpreted together with timeframe, instrument, market regime, expectancy, drawdown, dispersion, and other statistical characteristics.TIMEFRAMEThis strategy is designed specifically for:1-hour chartsThe script validates the chart timeframe and is not intended to be used unchanged on other timeframes.Testing the same logic on another timeframe may produce materially different results.CHART TYPEThe strategy is intended for use on standard price candles.Results obtained from synthetic or non-standard chart types may not represent executable market prices and should not be interpreted in the same way as results obtained from standard OHLC market data.ORIGINAL PURPOSE OF THE SCRIPTThis script is not intended to reproduce a standard Ichimoku indicator.Its purpose is to combine a specific five-condition decision framework with:- confirmed Ichimoku structure- pivot-based MACD momentum analysis- explicit equity-based risk modeling- fixed reward/risk targeting- maximum holding-time rules- gap-aware TRIM visualization- realized R distribution- expectancy analysis- outcome dispersion- exit-type classification- sample-size monitoringThe strategy is primarily a research and backtesting tool for studying the historical behavior of this specific rules-based setup.BACKTEST LIMITATIONSHistorical results are simulations and do not represent actual trading performance.Real-world results can differ due to factors including:- slippage- bid/ask spread- commissions- liquidity- market impact- order type- order priority- partial fills- trading halts- gaps- broker execution- exchange rules- data quality- corporate actions- symbol history- market regime changesHistorical OHLC bars also do not always reveal the exact sequence in which prices moved inside each bar.When multiple relevant price levels occur within the same historical bar, TradingView's broker emulator determines fills according to the information and execution assumptions available to the strategy.For this reason, individual historical fills should not be interpreted as a reconstruction of actual tick-by-tick execution.REPAINTING AND CONFIRMATIONTrade setups are based on confirmed bars.The momentum component uses confirmed pivots. Because pivot detection requires bars to the right of the pivot, a pivot is recognized only after its confirmation period has elapsed.This confirmation delay is part of the strategy logic and should be considered when interpreting signals.INTERPRETING RESULTSHistorical performance should not be evaluated from a single symbol, isolated market period, or individual trade.A more robust evaluation should consider:- a sufficiently large trade sample- different symbols- different market environments- trending and non-trending periods- drawdown- realized R distribution- expectancy- outcome dispersion- transaction costs- execution assumptionsChanging parameters can materially alter historical results and may introduce overfitting.Parameters should therefore be selected based on a defined trading hypothesis rather than solely because they improve historical performance.DISCLAIMERThis strategy is provided for educational, analytical, and research purposes only.It is not financial advice.It does not constitute an offer, solicitation, recommendation, or instruction to buy or sell any financial instrument.Historical performance does not guarantee future results.All trading and investment decisions, including position sizing and risk management, remain the sole responsibility of the user.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView