Ichimoku Cloud Back test

Very simple ichimoku strategy

Buy above the cloud and sell below it
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Thank you for sharing the code! I am a big fan!
+6 Reply
I'm doing something wrong. When I enter the code into Pine Editor then go back to Strategy Tester it's showing 'No Data'. Any idea where I'm going wrong? I'm trying to run the back test on a 5 min chart MESH2021
Can you convert the script to study?
Thanks a lot for this strategy Yo_adriiiiaan,

I tried to convert this to a study to make some alerts but it didn't go well, as every bar above the cloud was alerting 'long', and every bar under the cloud was alerting 'short'!
any help about that?

thanks in advance
Hello Yo_adriiiiaan
I am starting to learn to program and I am very unexpected with that do not feel offended by stupid questions that I will ask, since I already apologize.
This strategy of yours has been hammering in my head for about 3 months and you were the only one who perfectly represented the vision I had of a profitable robot.
I would like to ask a few questions about this script.
1- Can only be used in MetaTrade5
2- Why I use MetaTrade4
3- If it is for MT5 you would make a version for MT4 where I could try to create the robot from your script.
Yo_adriiiiaan you were the light that I needed to continue I had a loss of 65% of my investment was without a north and thanks to you my hope for better days has returned.
Thank you so much for sharing, big hug.
Hi, great work. May I ask how the strategy exits the trade? I got the impression that all opened trades are still open. Am I wrong? Thanks.
@vitelot, When it falls below the cloud it exits the long position and flips short. Vice versa for shorts
vitelot Yo_adriiiiaan
@Yo_adriiiiaan, yep, I don't see it in the code... Should be a strategy.exit or strategy.cancel added explicitly? Sorry, I'm a bit confused.
@vitelot, Strategy entry will close a trade and simultaneously enter a new trade so there's no need to have strategy exit etc..
thanks, great strategy
please add the input of the testing period
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out