Strategies we backtested Ichimoku Tenkan/Kijun cross

Tested by BacktestingMax

Ichimoku Tenkan/Kijun cross strategy backtest

Does the Ichimoku Tenkan/Kijun cross make money?

On some markets, yes: 13 of our 20 backtests made money from 2014 to 2025, after trading costs. The Tenkan/Kijun cross, or TK cross, uses Ichimoku, an indicator that draws five lines on the price chart. It buys when the fast line (the Tenkan-sen, 9 candles) crosses above the slow line (the Kijun-sen, 26 candles) on a candle that closes above the Ichimoku cloud, a band between two other Ichimoku lines. It sells short (sells first, to profit if price falls) in the opposite case. We call these the standard rules. We tested 10 markets (6 currency pairs, gold and 3 stock indices), each on 1-hour and 4-hour charts. Gold and the 3 yen pairs (USD/JPY, EUR/JPY and GBP/JPY) did best: they made money in 7 of their 8 tests. 8 tests made money in both the older years (2014–2021) and the newer years (2022–2025), but most of the newer years' profit came in 2022: in 2023, 2024 and 2025, the 20 tests together made almost no money. Adding the Chikou span confirmation, a common extra Ichimoku rule explained below, made little difference: 9 tests made money in both periods instead of 8.

20 backtests 2014–2025 Trading costs included Tested 12 October 2026

Where it worked 20 backtests
Made money
13
of 20 tests, using the standard rules
Made money in both periods
8
2014–2021 and again 2022–2025
Best backtest
+284%
USD/JPY, 1-hour chart: account growth 2014–2025
With the Chikou span confirmation
9
tests made money in both periods, compared with 8 using the standard rules

Made money in both periods

  • EUR/USD, 4-hour
  • USD/JPY, 1-hour
  • USD/JPY, 4-hour
  • EUR/JPY, 1-hour
  • GBP/JPY, 1-hour
  • Gold, 1-hour
  • Gold, 4-hour
  • DAX, 1-hour

The results

Results on every market

Each box shows one backtest of the Ichimoku Tenkan/Kijun cross using the standard rules, from 2014 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2014–2021 and 2022–2025, or passed all four of our checks (see "How a test passes" further down).

Market 1-hour 4-hour
EUR/USD +28% Made money overall, lost in one period +19% Made money in both periods
GBP/USD −6% Lost money +19% Made money overall, lost in one period
AUD/USD −41% Lost money −23% Lost money
USD/JPY +284% Made money in both periods +43% Passed all four checks
EUR/JPY +138% Made money in both periods −19% Lost money
GBP/JPY +70% Made money in both periods +26% Made money overall, lost in one period
Gold +61% Made money in both periods +66% Passed all four checks
S&P 500 −88% Lost money −15% Lost money
Nasdaq 100 −25% Lost money +9% Made money overall, lost in one period
DAX +111% Made money in both periods +7% Made money overall, lost in one period
All the numbers, test by test
Market Chart Trades Win rate Profit factor Result Max drawdown 2014–2021 2022–2025 Monte Carlo drawdown Trading costs
EUR/USD 1-hour 1,340 34% 1.03 +27.8% −40.5% +46.0% −12.5% −56.0% $5,288
EUR/USD 4-hour 327 35.8% 1.10 +19.0% −21.5% +13.0% +5.3% −29.5% $516
GBP/USD 1-hour 1,354 33.8% 0.99 −5.7% −42.5% +24.5% −24.3% −60.5% $5,280
GBP/USD 4-hour 325 36.6% 1.09 +18.6% −14.4% +20.3% −1.4% −30.2% $598
AUD/USD 1-hour 1,358 32.3% 0.94 −40.9% −57.8% −4.6% −38.0% −70.5% $5,125
AUD/USD 4-hour 315 33.7% 0.85 −23.1% −27.0% −14.2% −10.4% −40.7% $525
USD/JPY 1-hour 1,276 36.2% 1.20 +283.8% −42.2% +54.4% +148.6% −43.6% $7,588
USD/JPY 4-hour 332 35.2% 1.22 +42.7% −12.8% +2.6% +39.1% −27.8% $524
EUR/JPY 1-hour 1,265 36.5% 1.13 +138.3% −26.3% +112.2% +12.3% −44.8% $7,548
EUR/JPY 4-hour 343 32.4% 0.89 −19.4% −25.2% −2.3% −17.5% −41.1% $555
GBP/JPY 1-hour 1,312 36.1% 1.07 +70.3% −33.4% +49.1% +14.2% −49.6% $8,695
GBP/JPY 4-hour 323 35% 1.13 +25.6% −21.5% +36.6% −8.0% −31.4% $895
Gold 1-hour 1,353 33.8% 1.07 +60.5% −49.6% +34.1% +19.7% −55.2% $7,219
Gold 4-hour 316 34.5% 1.36 +66.0% −11.9% +29.7% +28.1% −24.7% $725
S&P 500 1-hour 1,449 29.7% 0.72 −87.7% −88.7% −82.2% −30.8% −90.8% $2,540
S&P 500 4-hour 331 34.1% 0.90 −14.9% −38.9% −21.3% +8.1% −39.9% $478
Nasdaq 100 1-hour 1,411 33.1% 0.96 −25.0% −44.8% −25.7% +1.0% −67.1% $5,601
Nasdaq 100 4-hour 317 36.9% 1.07 +9.1% −29.6% −12.4% +24.5% −29.2% $534
DAX 1-hour 1,314 32.2% 1.09 +110.5% −48.7% +41.8% +48.5% −51.9% $3,876
DAX 4-hour 350 34.3% 1.04 +6.7% −27.7% −9.6% +18.0% −33.2% $244

Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2014–2021 and 2022–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.

The account balance

The best test and the middle test

Best test USD/JPY, 1-hour chart +283.8% from 2014 to 2025
Middle test (median): half of the 20 did better, half did worse EUR/USD, 4-hour chart +19.0% from 2014 to 2025

What we found

What the 20 backtests show

  1. The yen pairs and gold did best. USD/JPY, EUR/JPY, GBP/JPY and gold made money in 7 of their 8 tests, and 6 of those 7 made money in both 2014–2021 and 2022–2025. The best backtest was USD/JPY on the 1-hour chart: +283.8% from 2014 to 2025. At one point, its account was 42.2% below its highest balance up to that time. R is the money one trade risks: 1% of the account. On the 3 yen pairs, most of the profit came from buy trades: across their 6 tests, the buy trades made 363.8R and the sell trades made 17.1R. From 2014 to 2025, the Japanese yen lost value: USD/JPY rose about 49%. When the yen loses value, a yen pair goes up, so buy trades on the yen pairs gained.

  2. The cloud rule (buy only when the candle closes above the cloud, sell only when it closes below the cloud) helped on currency pairs and gold, but not on stock indices. Without the cloud rule, the strategy trades every cross. Trading every cross made 39,682 trades, compared with 16,711 with the cloud rule. Only 9 of the 20 tests made money from 2014 to 2025, compared with 13. On the 6 currency pairs and gold, the cloud rule gave a better result in 11 of 14 tests. USD/JPY on the 1-hour chart was one of the 3 exceptions. On the S&P 500, the Nasdaq 100 and the DAX, the cloud rule made results worse: trading every cross gave a better result in 5 of 6 tests (see the table below). With the cloud rule, the S&P 500 buy trades lost 53.9R in total across the 2 S&P 500 tests, even though the index rose 270.6% from 2014 to 2025.

  3. Most of the profit in 2022–2025 came from 2022. We added up the results of all 20 tests for each year, in R. Each trade counts in the year it opened. Together, the 20 tests made 144.2R in 2022, and the 3 yen pairs made 113.4R of that. The 20 tests together then made only 10.5R in 2023, 7.2R in 2024 and 5.6R in 2025. So from 2023 to 2025, about 1,400 trades a year made almost no profit. These are totals: in those years, some tests made money and others lost about as much.

  4. Two other common Ichimoku rules made little difference: the Chikou span confirmation, and closing the trade at the Kijun-sen. The Chikou span is the latest close, drawn 26 candles back. With the Chikou confirmation, a buy also needs the latest close to be higher than the close 26 candles earlier, and a sell needs it lower. From 2014 to 2025, 12 of 20 tests made money with it, compared with 13 with the standard rules. On 4-hour charts, it raised the average trade from 4.1% to 6.0% of the money risked. On 1-hour charts, it lowered it from 2.3% to 1.7%. With the Kijun-sen exit, a buy closes at the next candle's open after a candle closes below the Kijun-sen, and a sell after a candle closes above it. The losing trades got smaller: on average, they lost 0.67 times the money they risked, compared with 0.82 times. But the winning trades got smaller too: 1.53 times the money they risked, compared with 1.67 times. From 2014 to 2025, 13 of 20 tests made money with the Kijun-sen exit, the same as with the standard rules.

  5. Daily charts gave too few trades to judge each market on its own. Ichimoku's standard settings (9, 26 and 52 candles) were first chosen for daily charts, so we also tested the strategy on daily charts, from 2014 to 2025. Each market made only 49 to 61 trades, fewer than the 100 trades we need before we judge a test (see the chart below). With fewer trades, a good result could be luck. All 10 markets together made 541 trades, and the average daily trade made 7.3% of the money it risked, more than on 4-hour charts (4.1%) and 1-hour charts (2.3%). But in a longer daily test, from 2005 to 2025, only 3 of the 7 markets we could test that far back (the 6 currency pairs and gold) made money. Half of the daily trades stayed open longer than 25 days, so overnight (swap) fees, which this test leaves out, would matter more on daily charts.

The cloud rule

The cloud rule helped on currency pairs and gold, not on stock indices

Each row groups the 1-hour and 4-hour tests of the markets in that row, from 2014 to 2025, after trading costs. With the cloud rule (the standard rules), a buy needs the candle to close above the cloud, and a sell needs it to close below the cloud. Without the cloud rule, the strategy trades every cross. The average trade is the average result of one trade, as a share of the money it risked. For example, +7.9% means the average trade made 7.9% of the money it risked.

Markets Made money, with the cloud rule Made money, trading every cross Average trade, with the cloud rule Average trade, trading every cross
USD/JPY, EUR/JPY, GBP/JPY 5 of 6 3 of 6 +7.9% +3.8%
EUR/USD, GBP/USD, AUD/USD 3 of 6 1 of 6 +0.7% −2.1%
Gold 2 of 2 2 of 2 +7.4% +3.7%
S&P 500, Nasdaq 100, DAX 3 of 6 3 of 6 −1.9% +1.3%
All 20 tests 13 of 20 9 of 20 +2.7% +1.3%

The two biggest results of all the versions we tried came from trading every cross on 1-hour charts: +961.1% on USD/JPY and +911.5% on the DAX, compared with +283.8% and +110.5% with the cloud rule. The 'Best backtest' at the top of this page counts only the standard rules. Trading every cross made more than twice as many trades, so a smaller average trade could still add up to a bigger result. But neither of those two tests passed all four of our checks: both failed the fourth check, on drawdown with shuffled trades, and the DAX test also failed the third, on profit factor in 2022–2025 (see 'How a test passes').

Daily charts

On daily charts, 7 of 10 markets made money, but each made only 49 to 61 trades

Ichimoku's standard settings, 9, 26 and 52, were first chosen for daily charts. So we also ran the standard rules on daily charts, from 2014 to 2025, on the same 10 markets. These 10 tests are not part of the 20 tests above, because each made fewer than the 100 trades we need to judge one test. Each bar shows the change in the account, after trading costs.

  • EUR/USD49 trades +16.2%
  • GBP/USD53 trades +2.5%
  • AUD/USD49 trades −13.6%
  • USD/JPY53 trades +0.1%
  • EUR/JPY61 trades +11.1%
  • GBP/JPY54 trades −4.7%
  • Gold61 trades +16.6%
  • S&P 50051 trades −2.2%
  • Nasdaq 10050 trades +11.4%
  • DAX60 trades +2.2%

USD/JPY made only +0.1%. 38.8% of the 541 daily trades won. The longer daily test, from 2005 to 2025, covered the 6 currency pairs and gold, because our stock index data does not go back that far. For that test, the two periods were 2005–2017 and 2018–2025. Only gold passed all four of our checks: +47.5% in 104 trades. EUR/USD (+25.4%) and EUR/JPY (+17.3%) also made money, and the other 4 markets lost money.

The strategy

What the Ichimoku Tenkan/Kijun cross is

Ichimoku Kinko Hyo, usually just called Ichimoku, is an indicator that draws five lines on the price chart. The Tenkan-sen (conversion line) is halfway between the highest high and the lowest low of the last 9 candles. The Kijun-sen (base line) is halfway between the highest high and the lowest low of the last 26 candles, so it moves more slowly. Senkou Span A is halfway between the Tenkan-sen and the Kijun-sen. Senkou Span B is halfway between the highest high and the lowest low of the last 52 candles. Ichimoku draws both spans 26 candles ahead, to the right of the latest candle, and the band between them is called the cloud. So the cloud under a candle was calculated 26 candles earlier. The fifth line, the Chikou span (lagging span), is the latest close, drawn 26 candles back, to the left. When the Tenkan-sen crosses the Kijun-sen, traders call it a TK cross. Many traders use the cloud as a filter: they buy on a TK cross only when price is above the cloud, and sell only when price is below it. We tested this filter with the close of the candle where the lines cross. Ichimoku books call a TK cross strong when the two lines themselves cross above the cloud (for a buy) or below it (for a sell). Our rule checks the candle's close instead.

Ichimoku
9, 26 and 52, the standard settings: the Tenkan-sen uses the last 9 candles, the Kijun-sen the last 26, and Senkou Span B the last 52. The cloud is drawn 26 candles ahead, and the Chikou span 26 candles back.
Cloud rule
The candle where the lines cross must close above both Senkou Span A and Senkou Span B for a buy, or below both for a sell. These are the cloud values under that candle, calculated 26 candles earlier.
Stop-loss
2 × ATR(14). ATR (average true range) is how far price moves in an average candle, measured over the last 14 candles.
Take-profit
None. The next cross the other way closes the trade.
Risk per trade
1% of the account
Overnight (swap) fees
Not included. Brokers charge or pay a fee for keeping a trade open overnight. The fee depends on the market and on whether you buy or sell. On 1-hour charts, half of the trades closed within 17 hours. On 4-hour charts, half of the trades stayed open longer than 3.8 days, and 1 in 4 stayed open a week or longer. So with a real broker, the results could be higher or lower, on 4-hour charts more than on 1-hour charts.

The rules we tested

  1. A cross means the Tenkan-sen was below the Kijun-sen and is now above it, or the Tenkan-sen was above the Kijun-sen and is now below it. We check for a cross when each candle closes. If the two lines are equal for a few candles, we compare with the last candle where they were not equal. So lines that touch and then move apart on the same side do not make a cross.
  2. Buy when the Tenkan-sen crosses above the Kijun-sen and the candle closes above the cloud under that candle, which means above both Senkou Span A and Senkou Span B. The trade opens at the next candle's open.
  3. Sell short when the Tenkan-sen crosses below the Kijun-sen and the candle closes below the cloud.
  4. Skip a buy cross if the candle closes inside or below the cloud, and skip a sell cross if the candle closes inside or above the cloud. We do not enter later, even if price leaves the cloud a few candles after the cross.
  5. When the two lines cross the other way, close the trade at the next candle's open. The cloud does not matter for this exit. If the cross also meets the rules for a trade the other way, the new trade opens one candle after the old trade closes.
  6. ATR (average true range) is an indicator of how far price moves in an average candle, measured over the last 14 candles. Put the stop-loss 2 times the ATR away from the close of the candle before the trade opens (usually the candle where the lines cross): below that close for a buy, above it for a sell. The stop-loss does not move. After a stop-loss, wait for the next cross that meets the rules, in either direction.
  7. Size every trade so that, if the stop-loss is hit, the trade loses 1% of the account.

The method

How we tested it

The test

Markets
EUR/USD, GBP/USD, AUD/USD, USD/JPY, EUR/JPY, GBP/JPY, Gold, S&P 500, Nasdaq 100 and DAX
Charts
1-hour and 4-hour candles
Dates
January 2014 to December 2025
Account
$10,000, risking 1% of the account on each trade
Trading costs
Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.

How a test passes

We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.

  • At least 100 trades. With fewer trades, a good result could be luck.
  • It made money from 2014 to 2021 and again from 2022 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
  • A profit factor (the money won divided by the money lost) of at least 1.2 from 2022 to 2025, after trading costs.
  • In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.

Improvements

Can the Ichimoku Tenkan/Kijun cross be improved?

We tried three changes Ichimoku traders often make, one at a time, on the same 10 markets and 2 charts (20 tests). The first drops the cloud rule and trades every cross. The second adds the Chikou span confirmation. The third closes each trade at the Kijun-sen, instead of at the next cross. A change picked because it did best on some years will almost always look good on those same years. So we picked the best change using 2014–2021 only, by the number of tests that made money. Then we checked it on 2022–2025, the years we did not use to pick it.

Version Made money 2014–2021years used to pick the best version Made money 2022–2025years not used to pick it Made money in both periods Passed all four checks
Standard rules The rules under 'The rules we tested', with nothing changed. 12 of 20middle test +16.6% 12 of 20middle test +6.7% 8 2
Every cross, without the cloud rule Trade every cross of the Tenkan-sen and the Kijun-sen, wherever the candle closes compared with the cloud. A cross the other way closes the open trade at the next candle's open. A new trade the other way opens one candle after the old trade closes. The stop-loss stays the same. 12 of 20middle test +10.1% 11 of 20middle test +2.9% 7 0
With the Chikou span confirmationBest on 2014–2021 The Chikou span is the latest close, drawn 26 candles back. Only buy if the Chikou span is above the price at that point, which means the latest close is higher than the close 26 candles earlier. Only sell if it is lower. Some traders also want the Chikou span above the cloud, or above the highs of the candles there. We tested the simple version: close against close. 13 of 20middle test +5.6% 12 of 20middle test +3.1% 9 3
Exit at the Kijun-sen Close a buy at the next candle's open after a candle closes below the Kijun-sen, and a sell after a candle closes above it. A cross the other way no longer closes the trade: while a trade is open, a new cross is skipped, unless that same candle also closes beyond the Kijun-sen. Many traders use the Kijun-sen this way, as a trailing stop: a stop that follows price as the trade moves. After a Kijun-sen exit, wait for the next cross that meets the rules. The stop-loss at 2 times the ATR stays the same. 12 of 20middle test +11.3% 12 of 20middle test +2.1% 8 2

No change clearly beat the standard rules. In 2014–2021 alone, the years we used to pick the best change, the Chikou span confirmation did best: 13 of 20 tests made money with it, compared with 12 with the standard rules. In 2022–2025, the years we kept for the check, 12 of 20 tests made money with it and 12 without it. In 2022–2025, the middle test (half of the 20 did better, half did worse) made +3.1% with the Chikou rule, compared with +6.7% with the standard rules. 9 tests made money in both periods with the Chikou rule, compared with 8 with the standard rules. Exiting at the Kijun-sen made money in 12 of 20 tests in 2014–2021, and in 12 of 20 in 2022–2025. The Kijun-sen exit's middle test made +2.1% in 2022–2025, compared with +6.7% with the standard rules. Trading every cross did worst: in 2022–2025, 11 of 20 tests made money, 7 made money in both periods, and no test passed all four of our checks, not even the two biggest results on this page (+961.1% and +911.5%).

Passed all four checks with the Chikou span confirmation

  • USD/JPY, 4-hour
  • Gold, 4-hour
  • Nasdaq 100, 4-hour

Questions

Questions traders ask

Does the Ichimoku TK cross strategy work?

On some markets. In our backtest from 2014 to 2025, with trading costs, the Tenkan/Kijun cross with the cloud rule made money in 13 of 20 tests (10 markets, each on 1-hour and 4-hour charts). The cloud rule means: buy only when the candle closes above the Ichimoku cloud, and sell only when it closes below the cloud. The strategy did best on gold and the 3 yen pairs (USD/JPY, EUR/JPY and GBP/JPY): these 4 markets made money in 7 of their 8 tests. It lost money on AUD/USD and the S&P 500 on both the 1-hour and the 4-hour chart. 8 tests made money in both 2014–2021 and 2022–2025, but most of the 2022–2025 profit came in 2022. In 2023, 2024 and 2025, the 20 tests together made almost no money.

What is the best timeframe for the Ichimoku TK cross?

In our test, neither the 1-hour nor the 4-hour chart was clearly better, and daily charts had too few trades to judge. The strategy made money on 7 of 10 markets on 4-hour charts, and on 6 of 10 on 1-hour charts. But more 1-hour tests made money in both 2014–2021 and 2022–2025: 5, compared with 3 on 4-hour charts. The average trade made 4.1% of the money it risked on 4-hour charts, and 2.3% on 1-hour charts. Trading costs are part of the reason: on average, the costs were 3.5% of the money each trade risked on 1-hour charts, and 1.6% on 4-hour charts. On daily charts, each market made only 49 to 61 trades from 2014 to 2025. The average daily trade made 7.3% of the money it risked, but in a longer daily test, from 2005 to 2025, only 3 of the 7 markets we could test that far back (the 6 currency pairs and gold) made money.

Should you only take TK crosses above the cloud?

On currency pairs and gold, yes, in our test. On stock indices, no. With the cloud rule (buy only when the candle closes above the cloud, sell only when it closes below it), 13 of 20 tests made money from 2014 to 2025. When the strategy traded every cross, 9 of 20 tests made money. On the 6 currency pairs and gold, the cloud rule gave a better result in 11 of 14 tests; USD/JPY on the 1-hour chart was one of the exceptions. On the S&P 500, the Nasdaq 100 and the DAX, trading every cross gave a better result in 5 of 6 tests.

Does the Chikou span confirmation improve the TK cross?

Not clearly, in our test. The Chikou span is the latest close, drawn 26 candles back on the chart. With the Chikou confirmation, a buy also needs the latest close to be higher than the close 26 candles earlier, and a sell needs it lower. It made about 20% fewer trades. From 2014 to 2025, 12 of 20 tests made money with it, compared with 13 without it, and 9 made money in both 2014–2021 and 2022–2025, compared with 8. On 4-hour charts, it helped: the average trade made 6.0% of the money it risked, compared with 4.1%. On 1-hour charts, it did not help: the average trade made 1.7% of the money it risked, compared with 2.3%.

The strategy code we ran

This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.

class IchimokuTkCross(Strategy):
    """The Ichimoku Tenkan/Kijun cross (the "TK cross") as most traders learn it, plus three
    changes traders often make.
    Standard (all switches off): buy when the Tenkan-sen (the middle of the last 9 candles'
    range) crosses above the Kijun-sen (the middle of the last 26 candles' range) on a candle
    that closes above the cloud. Sell short when the Tenkan-sen crosses below the Kijun-sen on
    a candle that closes below the cloud. The opposite cross closes the trade; if that cross
    also meets the entry rule for the other side, a trade the other way opens one candle after
    the exit fills (also when the stop-loss was hit on the cross candle). A stop-loss
    2 x ATR(14) away caps each trade; size so that the stop costs 1% of the account. After a
    stop-loss, wait for the next cross.
    A cross means the Tenkan-sen moved from one side of the Kijun-sen to the other. While the
    two lines are equal, the last side counts, so lines that touch and part on the same side
    give no signal.
    The changes, one at a time:
      no_cloud   = 1   trade every cross, wherever the candle closes compared with the cloud
      chikou     = 1   Chikou span confirmation: Ichimoku draws the Chikou span (the latest close)
                       26 candles back. Only buy if it is above the price there (the close is
                       higher than the close 26 candles ago); only sell if it is below
      kijun_exit = 1   close a buy when a candle closes below the Kijun-sen, and a sell when a
                       candle closes above it, instead of waiting for the opposite cross
                       (the Kijun-sen as a trailing exit; the 2 x ATR stop-loss stays)
    """
    params = {"tenkan": Param(type=int, default=9, min=2, max=200),
              "kijun": Param(type=int, default=26, min=2, max=200),
              "senkou_b": Param(type=int, default=52, min=2, max=500),
              "displacement": Param(type=int, default=26, min=1, max=200),
              "atr_mult": Param(type=float, default=2.0, min=0.5, max=5.0),
              "no_cloud": Param(type=int, default=0, min=0, max=1),
              "chikou": Param(type=int, default=0, min=0, max=1),
              "kijun_exit": Param(type=int, default=0, min=0, max=1)}
    lookback = 120
    def init(self, ctx):
        self.ich = ctx.indicator("builtin:ichimoku", tenkan=ctx.params.tenkan, kijun=ctx.params.kijun,
                                 senkou_b=ctx.params.senkou_b, displacement=ctx.params.displacement)
        self.atr = ctx.atr(period=14)
        self.side = 0           # +1 Tenkan above Kijun, -1 below; equal candles keep the last side
        self.reverse_to = None  # "long" / "short": open this once the closing trade is gone
    def on_bar(self, ctx):
        t, k = self.ich.tenkan[0], self.ich.kijun[0]
        # The cross is tracked on every candle, before any early return.
        cross_up = cross_down = False
        if t is not None and k is not None and t != k:
            now = 1 if t > k else -1
            cross_up = self.side == -1 and now == 1
            cross_down = self.side == 1 and now == -1
            self.side = now
        a, b = self.ich.span_a[0], self.ich.span_b[0]   # the cloud under this candle
        atr = self.atr.value
        if t is None or k is None or a is None or b is None or atr is None:
            return
        d = ctx.params.displacement
        entry = ctx.close[0]
        top, bottom = max(a, b), min(a, b)
        use_cloud = ctx.params.no_cloud == 0
        use_chikou = ctx.params.chikou == 1
        long_ok = ((not use_cloud or entry > top)
                   and (not use_chikou or entry > ctx.close[d]))
        short_ok = ((not use_cloud or entry < bottom)
                    and (not use_chikou or entry < ctx.close[d]))
        pos = ctx.position
        if pos is not None:
            opposite = cross_down if pos.is_long else cross_up
            if ctx.params.kijun_exit == 1:
                exit_now = entry < k if pos.is_long else entry > k
            else:
                exit_now = opposite
            if exit_now:
                ctx.close_position()
                # A cross the other way on the exit candle opens a trade the other way, if it
                # meets the entry rule, once this trade is gone.
                if opposite and (short_ok if pos.is_long else long_ok):
                    self.reverse_to = "short" if pos.is_long else "long"
            return
        # A reversal waits one candle for the exit to fill. Drop it if the lines crossed back
        # or the close is no longer on the right side of the cloud.
        pending, self.reverse_to = self.reverse_to, None
        go_long = cross_up or (pending == "long" and t > k)
        go_short = cross_down or (pending == "short" and t < k)
        if ctx.gate("tenkan_crosses_up", go_long) and ctx.gate("long_filters", long_ok):
            stop = entry - ctx.params.atr_mult * atr
            ctx.buy(size=ctx.size_by_risk_pct(0.01, stop=stop, entry=entry), sl=stop, tag="tk_long")
        elif ctx.gate("tenkan_crosses_down", go_short) and ctx.gate("short_filters", short_ok):
            stop = entry + ctx.params.atr_mult * atr
            ctx.sell(size=ctx.size_by_risk_pct(0.01, stop=stop, entry=entry), sl=stop, tag="tk_short")

Your turn

Test the Ichimoku Tenkan/Kijun cross yourself

Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the Ichimoku Tenkan/Kijun cross with the cloud rule on USD/JPY, 1-hour chart, from 2014 to 2025, with a 2 × ATR(14) stop-loss and 1% risk per trade.

Try it free in BacktestingMax

Free account. No credit card needed.

See every strategy we tested Browse strategies shared by traders

Backtest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 12 October 2026.