Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

Ichimoku Cloud Scanner v2.0 – AFL Code

1 min read


[wp_ad_camp_5]

 
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.

Ichimoku Cloud Scanner – Amibroker AFL Code
https://gist.github.com/2fdc650dd1774f9198241f959b089161

Download Ichimoku Cloud Scanner V2.0

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

Rajandran R Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, USDINR and High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Strongly believe that market understanding and robust trading frameworks are the key to the trading success. Writing about Markets, Trading System Design, Market Sentiment, Trading Softwares & Trading Nuances since 2007 onwards. Author of Marketcalls.in)

[Live Coding Webinar] Build Your First Trading Bridge for…

In this course, you will be learning to build your own trading bridge using Python. This 60-minute session is perfect for traders, Python enthusiasts,...
Rajandran R
1 min read

[Webinar] Understanding and Mitigating Curve Fitting in System Trading

"Understanding and Mitigating Curve Fitting in System Trading"! This dynamic session aims to equip novice to intermediate traders, quantitative analysts, and financial engineers with...
Rajandran R
1 min read

P-Signal Strategy Long Only Strategy – Amibroker AFL Code

This tutorial provides an overview of the P-Signal reversal strategy, a quantitative trading strategy that utilizes statistical parameters and error functions to generate probabilistic...
Rajandran R
2 min read

24 Replies to “Ichimoku Cloud Scanner v2.0 – AFL Code”

  1. 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
    regards
    geet

  2. @Geet

    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.

  3. 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

  4. 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) ),
    PREV),
    ( H – 3*ATR(10) ));

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

    StopLong:=If(Stop1>Stop2,Stop1,Stop2);

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

    StopShort:=If(Stop1<Stop2,Stop1,Stop2);

    If(BarsSince(LBarsSince(H>Ref(StopShort,-1)),StopLong,StopShort);

    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.

    Thanks
    Viswanath MK

  5. 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.
    Latha.

  6. Sorry, I am an idiot. How do I exactly implement this code? I am not a programmer and I have a very limited idea of how programming works.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More