Ichimoku Cloud Scanner v2.0 – AFL Code

The Demerit with the older version of Ichimoku cloud scanner is that there is too much of difference between the cloud(stop loss) and the candle which has been overcome by introducing stop loss for the trade with little modification in the trading rules.

The above nifty chart shows a trailing stop loss(black line) of 6034. But the cloud(6137) is heavily far from the Close value(5751).

Note : Black line indicate only trailing stop loss for trades but not a trailing stop loss mechanism.

Trading Rules

1)Buy on Close above the cloud
2)Sell on Close below the cloud
3)Use the Cloud as Stop loss and reverse when the cloud is very near to the candle
3)Use STPL – (Black line) as trailing stop loss when the candle is far from the cloud
4)There is nothing to do with the color of the cloud( red/green cloud it doesnt matter )
5)Red Arrows indicates sell signal i.e candle closes below the cloud
6)Green Arrows indicates Buy Signal i.e candle closes above the cloud

Where STPL is nothing but the average of Close, Span lines SP1,SP2

Few Rules that I for the shorter timeframes 15min, 30min, hourly Charts and Daily

1)Buy or Sell Trade should be taken only on the presence of the appropriate signal. Trade should not me initiated belated to the signal

2)Dont initiate trade without sufficient signals.

3)If you are in a Buy Trade/Sell Trade book the trade if you are in profit at regular intervals. Dont wait for the next signal to exit the trade

4)For 15min trade book profit if you got 20-25pts in nifty and in Hourly Charts – 50-75 points and in Daily Charts – 150-200pts without waiting for next signal.

5)Respect the trailing stop loss when you are in trade

6)If you are confused with the way you are playing – just take rest.

Download Ichimoku Cloud Scanner V2.0

If you have a better Stop loss/SAR mechanism please let me know

Related Readings and Observations

Rajandran R

Rajandran is a trading strategy designer and founder of Marketcalls, a hugely popular trading site since 2007 and one of the most intelligent blog in the world to share knowledge on Technical Analysis, Trading systems & Trading strategies. More From Rajandran R »

22 comments… add one

  • sandip November 28, 2010, 3:29 pm

    Sir, link is not downloadable….. i tried many times.

  • Rajandran R November 28, 2010, 3:31 pm

    Sandip – it got fixed try now

  • sandip November 28, 2010, 3:57 pm

    now downloded. thanks sir.

  • Devansh November 28, 2010, 7:59 pm

    Sir, You could possibly look at a similar stop line for MT4 users as well ?

  • kalyan November 28, 2010, 9:15 pm

    now one is expected for scaning tinkensen kijun sen cross over as it may give earlier signal

  • Rajandran R November 28, 2010, 11:00 pm

    @Kalyan… I still consider Tenkan Sen, Kijun Sen, Chikou Span lines as noise to the system

  • Rajandran R November 28, 2010, 11:00 pm


    Iam not very much good with mql4 coding. anyways will try out my best!

  • Geet November 29, 2010, 9:58 am

    Dear Sir,

    Thank you for the AFL.
    A few questions:
    1) If we trade on the daily chart, then should the trade be taken on the opening of the following day or on the same day. Same with hrly chart should it be on the open of the next candle.

    2) if we book profit on regular intervals, then is there a way toget back into the trade especially when the market is strongly trending as of now.

    Thank you for your time and reply

  • hiren morbia November 29, 2010, 1:52 pm

    Hello Mr.Rajandran.

  • Devansh November 29, 2010, 6:57 pm

    Sir maybe an existing indicator that you feel will give similar results ?

  • Rajandran R November 29, 2010, 10:32 pm


    Its better to take on the same day if you are taking signals based on Daily charts. For Stop loss for the trade you can take cues from the hourly charts.

  • kalyan November 29, 2010, 10:41 pm

    sir this cross over save me and i exit

  • Rajandran R November 29, 2010, 11:00 pm


    Check out the Chartnexus settings for Ichimoku and provide your results

    The thing is to convert the ichimoku into a better trading system to capture the high probable trends.
    If Tenkan Sen, Kijun Sen, Chikou Span provides better stop loss and reversal strategy or a better filetering mechanism then kindly provide your views here

  • Rajandran R November 29, 2010, 11:05 pm

    Buy Signal in USD from ichimoku cloud charts with parameters 3,12,18.
    Tenkan Sen, Kijun Sen, Chikou Span lines are now nothing to do here

  • Rajandran R November 29, 2010, 11:16 pm

    Dow Jones under sell mode for the 4th day with cloud resistance coming near 11190

  • Geet November 29, 2010, 11:46 pm

    Thank you sir!

  • kalyan November 30, 2010, 9:16 pm

    my setting is default 9 and 16 for tinkensen and kijunsen .what i observed that this crossover wheather below the croud or over the cloud may be significant and in my opinion( may be i am wrong)this buy or sell signal is a powerfull than any ema cross over.
    if u can code this exploration will be helpfull .
    it will also help us study this crossover

  • viswanath mk January 21, 2011, 1:22 am

    Hellow dear Rajendran,

    Better stoploss is using Chandelier SL. I do not have code for AFL, but I do have for the same in metastock ( given below).

    Stop1:=If( PREV = PREV,
    ( H – 3*ATR(10) ),
    ( H – 3*ATR(10) ));

    Stop2:=If( PREV = PREV,
    ( C – 2.5*ATR(10) ),
    ( C – 2.5*ATR(10) ));


    Stop1:=If( PREV > H,
    If(( L + 3*ATR(10) ) H,
    If(( C + 2.5*ATR(10) ) <= PREV,
    ( C + 2.5*ATR(10) ),
    ( C + 2.5*ATR(10) ));



    I would like to say something from my bottom of myheart. You are great boss, that too at very younger age, you have very good knowledge & also sharing for others.

    May God bless you & gives lots of wealth, health to you.

    Viswanath MK

  • Radiate Labs March 3, 2011, 8:32 am


    I wanted to use this with broco trader or GCI or something like that how can i make it work with these platforms ???


  • Latha November 16, 2011, 10:58 am

    Hi Sir, Thank you for your valuable contributions to educat us.

    I am using Amibroker and copied your AFL codes to use.
    I am confused in one area is to which combination of signals need to pick up for shorter time frame trades.

    I am considering ony short time frame trades for weekly calls. If I use weekly view in charts using the afl code will the signals will be good? I tried with intraday and using seconds time frame signals are more with less difference of price.

    So i would like to take up for weekly/monthly calls . Please advice the best set of signals to use for this type of calls.

    Thank you in advance sir.

  • Vishal October 20, 2013, 11:53 am

    Can i use this indicator in Indian Commodity market

    • Rajandran R October 20, 2013, 5:29 pm

      Yes you can try out on hourly charts suits mostly for positional and investment purpose


Leave a Comment

Follow Us

Recommend on Google

About the Author

    • Rajandran is a Market Analyst and founder of Marketcalls, one of the most intelligent blog in the world to share knowledge on Technical Analysis, Trading systems & Trading strategies.