Menu
  • Option Hydra
  • Training
  • Premium
  • Courses
  • Library

Marketcalls

Simply Intelligent Technical Analysis and Trading Strategies

  • Software
    • Amibroker
    • NinjaTrader 7
    • Ninjatrader 8
    • Option Action
    • Market Analyst
    • Metatrader
    • Python
    • Datafeed
  • Market Profile
    • Orderflow
  • Markets
  • Commodities
  • Forex
  • Economy
    • Banking
  • Webinars
  • Trading Lessons
    • Algo Trading
    • Infographic
    • Video
You are here: Home / Amibroker / Super Trend – Intraday AFL code for Amibroker

Super Trend – Intraday AFL code for Amibroker

May 5, 2012 by Rajandran 171 Comments

Super trend is a popular mql strategy converted for the use of intraday amibroker Traders. And you can also watch the same indicator live with various instruments like Nifty , MCX Metals and for few stocks here

Features of the Super Trend AFL code

– Buy and Sell Signals(Green and Red Arrows)
– Trailing stop loss : For Buy signal trailing stop loss is displayed in Green color and for Sell it is Red color
– Template Displaying Buy/Sell Price, Trailing stop loss, Current profit.
– Target Lines T1,T2,T3 (Targets are just a rough estimation and to add value to the AFL code. Its not prediction based)
– Suits lower timeframes like 5min,1min, 15min, hourly timeframe.
– As usual Code is open source. Any body can use it, modify and reuse it.

Nifty Futures 15min charts

Watch Super Trend Trailer

 
Download Non Repainting Super Trend Indicator with time bar left AFL code

For Amibroker version less than 5.3 version

Download Super Trend for Old Amibroker Version

Trend Indicator with the new feature seconds left for the new bar to begin.

I would like each and everyone to go thro the nature of SuperTrend Optimized trading system

– To be honest the trading system accuracy is currently at 42% means out of 100 trades only 42 trades are profitable.

Then how does your wealth is created?
It created with discipline and proper money management to catch those 42% of Winning Trades and Exiting properly at Stop Loss Hits.

What is the maximum continious losses the trading system can yield?
Since 2010 after backtesting with 5min data it is inferred that till to date 9 consecuitve losses had occured. Refer with Bactest results.

What is the Best Paramters to fine tune the system to eliminate more whipsaws?
Optimized Parameters are Multiplier =2 and ATR=11. However the default values of trading system are Multiplier =3 and ATR=10.

For Which Instrument the Trading System is Optimized?
The Trading system is optimized for 5min Nifty Futures charts

Can i trade with Any other stocks/indices?
Stricly No. As the Trading system is optimized for 5min Nifty future charts only.

How to Enter and Exit?

Entry should be based on the completion of the close of 5min Bar Candle. Trade should be executed with 5secs once the 5min candle complete. Trade should not be executed before the completion of 5min bars.

Trade Should be taken only if you see the next bar open. And Strictly not at the intermediate points between the signals.

How many Nifty Future Lots is required to Trade the Trading system?
2 Lots (100 shares) of Nifty at any trades. Size of the trade should not vary throughout the trading system and it is fixed.

Can i trade using the live Buy or Sell indicator?
Charts shown in marketcalls is to study the nature of the trading system to improve your knowledge on trading system. If you are trading based on these buy and sell signals then do it at your own risk. marketcalls wont be responsible for the losses incurred.

Backtest Results
Super Trend Optimized Backtest Results from 1st Jan 2010 – 25th March 2012

Many hours has been spent on making this final code. So give your feedbacks here or mail to rajandran@marketcalls.in

Happy Trading!
Rajandran R
Founder – Marketcalls

Related Readings and Observations

  • Introduction to Backtesting a Trading System using AmibrokerIntroduction to Backtesting a Trading System using Amibroker Backtesting is a simple process which helps a trader to evaluate his trading ideas and provides information about how good the trading system performs on the given historical dataset. It […]
  • Supertrend Multi Timeframe Based Trading System – Amibroker AFL CodeSupertrend Multi Timeframe Based Trading System – Amibroker AFL Code Here is the first prototype from Marketcalls which demonstrates multi-timeframe based trading system which compares two timeframes (5min and hourly in this case) and takes a trade decision […]
  • Supertrend V5.0 – Amibroker AFL CodeSupertrend V5.0 – Amibroker AFL Code In the new version of Supertrend thought of removing ATR factor to make the trading strategy independent of volatility factor. It is a simple long/short strategy fits for trading lower […]
  • ATR Volatility Long Only Trading SystemATR Volatility Long Only Trading System Yet another ATR Volatility based Long only Trading System. ATR Volatility system a mechanical strategy for higher time-frames Written by Tudor Marcelin - Art Invest. Just modified the […]
  • Didi Index Long only Trading SystemDidi Index Long only Trading System Didi Index is a positional long only trading system constructed based on three exponential moving averages inspired from mql4 code Didi Index Indicator. Indicator developed by Brazilian […]
  • Internal Bar Strength – Mean Reversion Trading AFL codeInternal Bar Strength – Mean Reversion Trading AFL code Here is a simple mean reversion system adapted from IBS reversion edge with QuantShare. And our IBS mean reversion strategy is a slight variation of the Internal Bar Strength by taking a […]

Filed Under: Amibroker Tagged With: AFL Code, Amibroker, Super Trend, Technical Indicators, Trading System

About Rajandran

Rajandran is a Full time trader and founder of Marketcalls & Co-Founder of Traderscafe, trades mostly using discretionary Trading Concepts like Market Profile, Trading sentimental analysis, building timing models, algorithmic trading models. Instructs professional traders, full time traders & aspiring full time traders. Rajandran attended college in the Chennai where he earned a BE in Electronics and Communications. Rajandran has a broad understanding of trading softwares like Amibroker, Ninjatrader, Esignal, Metastock, Motivewave, Market Analyst(Optuma),Metatrader,Tradingivew,Python and understands individual needs of traders and investors utilizing a wide range of methodologies.

Comments

  1. sidharth says

    May 5, 2012 at 5:59 pm

    Please share the corresponding mql4 for gcimt4 too……………

    Reply
  2. dinesh says

    May 5, 2012 at 6:06 pm

    Good innovation rajendra .Now a days I am daily visiting to your blog and spending atleast 20 min in a day .
    and your blog is indian wikipedia in indian market .I would like to know how to test this code .

    Reply
  3. Rajandran R says

    May 5, 2012 at 6:30 pm

    @Dinesh : You need to do backtesting. Goto New Analysis ->Select the AFL file -> Set the Backtesting parameters ->Press backtest button->Click on the report button to view the test results.

    Any How will post short article soon on how to backtest using amibroker

    Reply
    • Nitin Agarwal says

      January 17, 2013 at 12:14 pm

      sir iam from bareilly u.p sir i had lost huge amount in mcx now iam in great prolem. sir please help me sir please suggest me that which software i should use to cover my losses, i dont know much about software system and how to use them but ihad a knowledge of physical market. my weaknness is i dont know where to put stopploss and where to take profit. sir please suggest me that i should go for which software. which will have the best results, iwill be very gratefull to you

      Reply
      • dinesh ahuja says

        June 20, 2015 at 7:58 pm

        hi Nitin Agarwal u r still in the market the u can reply me on my email i can help u in this
        i am in delhi

        Reply
  4. Rajandran R says

    May 5, 2012 at 6:31 pm

    @Sidharth : Link is given in the first line of the article.

    Reply
  5. shaggy says

    May 5, 2012 at 6:35 pm

    Greetings Brother….

    At the out set GOD BLESS YOU & YOUR FAMILY… before i give you the performance feedback of your AFL,
    I would like to give a feedback on your SELFLESS EFFORTS towards people from trading fraternity…
    RARE is the word for a person like you.. its a very humble work your are doing on the this space here…
    you will definitely get rewarded for all your support to all of us in one or the other way in your life…
    i will keep clicking all the adds on your site everyday as part of my support… thanks for everything…

    Coming back to AFL performance, i just checked the levels where the signals are generated and stunningly
    all are same when it compare to my PAID software…. what else we need??? people make life out of your site
    and bless you through their hearts…

    Great Work
    Take Care

    Shaggy Boo
    Bangalore

    Reply
  6. Harshit Patel says

    May 5, 2012 at 6:50 pm

    Hey Raj,

    Wanted to ask you a Question, If someone needs to learn the basics of Amibroker and how to use that, where can we find Tutorials or guide on that.

    Reply
  7. Rajandran R says

    May 5, 2012 at 7:01 pm

    @Harshit Patel

    You need to be clear what you are going to learn

    1) Do you want to Build your own trading system -- Then you need programming langugage skills to proceed. You can go to the amibroker website and download the AFL guide and proceed with that.

    2)Other wise if you want to test your own trading system and to optimize it then tutors are available in amibroker website itself.

    Reply
    • shreyas says

      April 1, 2015 at 8:00 am

      DEAR PRASHANT SIR,

      PLEASE CAN HELP ME OUT AFL CODE FOR BELOW STRATEGY
      I AM USING ONLY SIMPLE INTRADAY CANDLE SYSTEM FOR TRADING ONLY FOR NIFTY &ALL

      FOR EXAMPLE --
      I WANT BUY SELL SIGNAL IN BELOW CONDITION….
      BUY CONDITION :- WHEN MARKET IS UPTREND OPEN AFTER 1 ST 10 MIN IF 5 MIN CANDLE CLOSE ABOVE 3 POINTS COMPARE WITH PRE.CANDLE HIGH THEN WANT SHOW HERE BUY GNAL.
      & MY SL IS CLOSE BELOW 3 POINT OF 1ST 10 MIN CANDLE

      SELL CONDITION :- WHEN MARKET IS IN DOWNTREND OPEN AFTER 10 MIN IF 5 MIN CANDLE CLOSE BELOW 5 POINTS COMPARE WITH PRE.CANDLE LOW THEN WANT SHOW HERE SELL SIGNAL.& MY SL IS CLOSE ABOVE 3 POINT OF 1ST 10 MIN CANDLE

      NOTE -- I ALSO WANT TO CONDITION FOR TG 1ST.2ND.3RD..& SO ON FOR BOTH BUY & SELL CONDITION.. FOR EXAMPLE..-(IF BUY SIGNAL SHOW.AT NIFTY 8555 & SL IS 8540 SO MY 1 ST TG IS 15 POINTS)

      Reply
      • shreyas says

        April 1, 2015 at 8:20 am

        Please help me for above query Rajendran Sir

        Reply
  8. sidharth says

    May 5, 2012 at 7:21 pm

    @Rajandran…….that link gives a code but that does not have any buy sell signal…..etc. Also probably there are different settings…there are more whipsaws….can u please update the settings to the same as your AFL code

    Reply
  9. Rajandran R says

    May 5, 2012 at 7:42 pm

    @Sidharth : Yes the mql4 doesnt has any signal.

    The default parameters are Factor = 3 and ATR=10 and you can change those parameters for your requirement.

    Factor=Param(“Factor”,3,1,10,1);
    Pd=Param(“ATR Periods”,10,1,100,1);

    Reply
  10. shaggy boo says

    May 5, 2012 at 7:45 pm

    the last 3 signals(showing on the pic) are same in my software and let me instal the AFL and check it with Ami…

    Reply
  11. Rajandran R says

    May 5, 2012 at 7:57 pm

    @Shaggy boo

    Share your chart image here. If you dont know how to post charts in the comment section read this
    https://www.marketcalls.in/web-updates/share-your-charts-and-youtube-videos-with-marketcalls.html
    This could help you

    Reply
  12. vinay says

    May 5, 2012 at 9:04 pm

    i would say only one thing “god bless U”….U r the lighthouse of traders like us…..

    Reply
  13. Udit says

    May 5, 2012 at 11:41 pm

    DEAR RAJANDRAN,

    CAN YOU TELL ME WHICH AFL CODE IS USED IN THIS CHART ? IT’S LOOKING VERY GOOD. IS IT POSSIBLE TO MAKE THIS TYPE OF AFL CODE ?

    Reply
  14. cambatta says

    May 6, 2012 at 1:13 am

    We get different T1,T2,T3 for different time frames.

    I feel they should be the same.

    Reply
  15. Rajandran R says

    May 6, 2012 at 1:40 am

    @cambatta : Targets are decided based on the different timeframes

    Reply
  16. P. SHAILU says

    May 6, 2012 at 4:00 am

    AS FAR AS THE SUPER TREND INDICATOR IS CONCERNED ERROR 29 IS WHAT I AM FACING IT SAYS
    VARIABLE ‘ENTRY’ USED WITHOUT BEING INITIALIZED.

    Reply
  17. Rajesh says

    May 6, 2012 at 9:49 am

    Excellent Code !!

    Can you modify the AFL code to include the output for exploiration so that we can get parameters for all stocks in excel

    Reply
  18. Nitin Gupta says

    May 6, 2012 at 11:09 am

    Hi Rajandran,

    I checked the supertrend, it is not working on 15 minutes timeframe ( not profitable :result (-19.24%)). whereas
    on the 5 minute timeframe, it is giving too many calls, may be some refining on the calls like some filters would help it to be better… have u thought of including volume as an indicator for filtering calls.

    Reply
  19. rajesh says

    May 6, 2012 at 12:18 pm

    @udit

    if you can tell us which system is generating this signal then we can try for it…

    thanks

    Rajesh

    Reply
  20. P Shailu says

    May 6, 2012 at 1:40 pm

    Looks very nice but giving error ‘LINE 29 VARIABLE “ENTRY ” USED NOT BEING INITIALIZED PLS HELP

    Reply
  21. Rajandran R says

    May 6, 2012 at 1:41 pm

    @Nitin Gupta :

    What is your backtesting period?

    I had backtested for 3 years and the results are good and descent . If you want i can share with you

    Reply
  22. Rajandran R says

    May 6, 2012 at 1:47 pm

    @Rajesh

    Soon will add exploration parameters

    Reply
  23. vellingirinathan says

    May 6, 2012 at 2:05 pm

    sir super trend afl not working my sytem

    Reply
  24. raghu says

    May 6, 2012 at 2:29 pm

    sir i am new to trading… need help…. installed amibroker… and RTDS data for REAL time data…
    amibroker is showing NO data in it… how i would link the RTDS data to amibroker… amibroker data file is empty…
    RTDS has generated all its data in amibroker format and located a file at C:\NSEFUTURESAMI and ther is an other file at C:\Program Files\RTDS

    how i can make this data linked with my amibroker and how can i make my chart look like your chart in the video,,, please help

    thanks … raghu

    Reply
  25. rajesh says

    May 6, 2012 at 4:04 pm

    @Udit

    if its from Nexgen Revolution then the entire AFL is Based of Fimb…

    hope you have not back tested it yet…
    you can check the levels on the same day…. if others then please specify so that we arrive at AFL…
    see the image

    Reply
  26. dinesh says

    May 6, 2012 at 5:00 pm

    Rajendra :-Could you please explain how to test this code .I am very new in amibroker .This can be help for all naw user to explore this new area .If you have any such usefull link then please share us .I tried to dig out from google but not succicde.

    Reply
    • Rajandran R says

      May 6, 2012 at 6:54 pm

      dinesh follow this link to know how to backtest. And I also planned to post articles on backtesting very soon
      http://www.amibroker.com/guide/h_backtest.html

      Reply
  27. Udit says

    May 6, 2012 at 8:10 pm

    @ Rajesh,

    I got its image only from tradaerji.com I am not sure which AFL code are use. But I think it is heikein ashi chart and plot with zigzag indicator. I think it’s B/S signal generate after 4/5 candle (reprint signal). So it is useless.

    Reply
  28. Amirishali says

    May 7, 2012 at 1:01 am

    Rajandran….as usual,you are on cherryon top of the cream…let me test this.but as per ur glorious record…it should be fine.
    God Bless you for your selfless & tireless efforts!!!

    Amirishali

    Reply
  29. ajay choudhary says

    May 7, 2012 at 11:00 am

    THERE IS ERROR IN SUPER TREND AFL. CAN U HELP I AM ATTACHING JPEG FILE.

    Reply
  30. Mohsin says

    May 7, 2012 at 11:30 am

    Hi sir,

    please sir kindly give us a solution , i am using amibroker 5.20 and getting error 29 --
    variable ‘entry’ used without being initialized .. …

    please please -- this super trend afl is looking so good , thanks to you, but not able to use it because of error — please help

    Reply
  31. shaggy boo says

    May 7, 2012 at 12:12 pm

    Dear Raj…

    is it possible to make an alert out to show the list of all latest alerts generate through this AFL?

    is yes please let us know how to do it?

    regards

    shaggy boo

    Reply
  32. Mohsin says

    May 7, 2012 at 2:58 pm

    Sir, the afl is giving error 29.

    variable ‘ entry’ used without being initialized ,
    please help,

    this looks so good, but because of error not able to use it ,

    my amibroker ver 5.2

    thanks for your great work, but please help with this error soon,

    cant wait to see it working fast

    Reply
  33. Udit says

    May 7, 2012 at 7:30 pm

    Dear Rajandran,

    First so many thanks for this super trend AFL. Today its give amazing result in nifty. Good job, keep it up.

    Reply
  34. Udit says

    May 7, 2012 at 7:30 pm

    Dear Rajandran,

    First so many thanks for this super trend AFL. Today its give amazing result in nifty. Good job, keep it up.

    Reply
  35. vasanth kalyana kumar says

    May 7, 2012 at 7:31 pm

    Dear Rajandran

    I downloaded your super trend afl and used it. its very useful. Thanks a lot. More over i want to appreciate and say thanks to your SELFLESS EFFORTS.

    Reply
  36. dinesh sharma says

    May 7, 2012 at 10:32 pm

    Dear Rajendra

    Can you please tell me how can we conver Mql4 to Afl Or Afl in Mql for . Can u please guide me in this

    Reply
    • Rajandran R says

      May 8, 2012 at 12:35 am

      @Dinesh Sharma
      Its needs coding knowledge on mql4 and afl codes.

      Reply
  37. arjun says

    May 8, 2012 at 11:11 am

    Hi Rajandran,
    i am unable to backtest. Will u pls share backtesting reults for couple months depending on timeframe.
    And most important, on which which timeframe best results are seen….5min or 15 min.

    pls revert back

    Reply
    • Rajandran R says

      May 8, 2012 at 11:21 am

      Sure Arjun Preparing that. Will let you know soon.

      Reply
  38. arjun says

    May 8, 2012 at 11:21 am

    hi
    i don’t understand how my recent post has vanished Hence posting again.
    Rajandran i am unable to backtest.Wil u pls share backtesting resuts for couple month.
    And on which timeframe best results are seen? 5min or 15 min

    Reply
  39. arjun says

    May 8, 2012 at 11:40 am

    Rajandran, yes take your own time.

    Reply
  40. arjun says

    May 8, 2012 at 12:13 pm

    Rajandran, one more thing. As most of us are intraday aspirant traders/players.
    In your backtesting, my sense you will be giving arithmetic of plain entry and exit calcuations and returns and cumulative points etc. But it will be better if u can also add how many instances call was able to get xyz points, the bare minium points at which most of day traders look as first target.Some take as 15 or 20 or 25 depending on their mindst and brokerage.
    Today, Nifty FUTURE as per super trend gave a sell @5103 09.45 and reverse long came at 5106 11.10. So at first glance, it was a loss of 3 points. But there was a dip to 5072 means was a chnce of booking 15/20/25 points depending on persoanl first target level.I am aware of super trend’s T1/T2/T3. But i am talking about bare minium first target.Also you are welcome with analysis of supertrend’s T1/T2 achieved.

    Hope u get my point..

    Reply
  41. Ramakrishnan says

    May 8, 2012 at 12:26 pm

    Sir,

    I am using Amibroker 5.1. Today I have add your Super Trend Afl Code in my Amibroker 5.1 ver but it is showing error 29. Sir pls rectify and give at your earliest will me a Great needfull, also for Mr.Ajay choudhary & Mr.Mohsin. Expecting your reply very eagerly. Bye.

    Reply
  42. Ramakrishnan says

    May 8, 2012 at 12:27 pm

    Sir,

    I am using Amibroker 5.1. Today I have add your Super Trend Afl Code in my Amibroker 5.1 ver but it is showing error 29. Sir pls rectify and give at your earliest will do me a Great needfull, also for Mr.Ajay choudhary & Mr.Mohsin. Expecting your reply very eagerly. Bye.

    Reply
  43. Ramakrishnan says

    May 8, 2012 at 12:35 pm

    Sir

    I am using Amibroker 5.1 Ver. I am very much impressed by your Super Trend Afl Code and added in my Amibroker 5.1 Ver but it is giving error 29. Hence pls rectify & give at your earliest will do me a Great Needfull. Thank you. Bye.

    Reply
  44. Arvind says

    May 8, 2012 at 3:56 pm

    pls add COPPER, LEAD, and ZINC in realtime

    Reply
    • Rajandran R says

      May 8, 2012 at 4:07 pm

      It will be overloading my server. So currently not including it. Other wise in need to rent another server which is again costlier.

      Reply
  45. Dj says

    May 8, 2012 at 4:44 pm

    Hi Is This System Look In To Future Like Other System If Yes Then It’s Useless To Do Backtest And Use In Realtime

    Reply
  46. Mukesh Radia says

    May 8, 2012 at 10:09 pm

    Hi Rajandran R

    Many Of My Friends Using SuperTrend (ATR Length 5,ATR Multiplier 1,HighLow Bars 5) of FALCON software
    and i heard it gives excelant result and narrow stoploss for nifty and Banknifty (30Minites) Time Frame. And as per their record it gives highest return in backtest also

    I Tried Same Parameters In Amibroker in Your Super Trend afl file But it is not giving the same signals,

    I am encloseing niftycash5min.jpg file for your referance

    Hoping your early reply with best solution.
    Thanks

    Reply
  47. Mukesh Radia says

    May 8, 2012 at 10:20 pm

    Hi Rajandran R
    I Was serching supertrend formula for my amibroker since last 2 months i found best formula from your site.
    Many Of My Friends Useing Supertrend System (ATR Length 5days, ATR Mulitiplier 1 , Highlow Bar 5)
    For Nifty / Bank nifty in 30 miniutes time frame and it gives best result with narrow stoploss.

    I Change Parameters as per above mention in amibroker. But its not giving same indication as falcon software is giving. I enclosed please find nifty cash 5 min.jpg file for your referance.

    Reply
  48. Mukesh Radia says

    May 8, 2012 at 10:25 pm

    Hi Rajandran R
    I Was serching supertrend formula for my amibroker since last 2 months i found best formula from your site.
    Many Of My Friends Useing Supertrend System (ATR Length 5days, ATR Mulitiplier 1 , Highlow Bar 5)
    For Nifty / Bank nifty in 30 miniutes time frame and it gives best result with narrow stoploss.

    I Change Parameters as per above mention in amibroker. But its not giving same indication as falcon software is giving. I enclosed please find nifty cash 5 min.jpg file for your referance.

    Hopeing your best solution for the same

    Reply
  49. kalyan says

    May 9, 2012 at 8:04 am

    many thanx for this afl, its near pro afl. now in parameter what to set for factor from 1,2,3

    Reply
  50. Thanveer says

    May 9, 2012 at 9:37 am

    Sir can u pls upload the version with magified price?

    Reply
    • Rajandran R says

      May 9, 2012 at 9:45 am

      @Thanveer

      If you have Magnified Price then just append it to the code. It will be working.

      Reply
  51. P. SHAILU says

    May 9, 2012 at 11:28 pm

    HI,
    I HAVE JUST MIXED YOUR OLD & NEWER {FOR OLDER VERSIONS} AFL FOR SUPER TREND B’CAUSE THE NEWER VERSION WAS NOT SHOWING MASSAGE BOARD CHECK OUT & REPLY

    /* Done by Rajandran R */
    /* Author of https://www.marketcalls.in */

    _SECTION_BEGIN(“Price”);
    SetChartOptions(0,chartShowArrows|chartShowDates);
    _N(Title = StrFormat(“{{NAME}} -- {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}”, O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
    Plot( C, “Close”, ParamColor(“Color”, colorBlack ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );
    _SECTION_END();

    /* Done by Rajandran R */
    /* Author of https://www.marketcalls.in */

    _SECTION_BEGIN(“SuperTrend”);
    SetBarsRequired(100000,0);
    GraphXSpace = 15;
    SetChartOptions(0,chartShowArrows|chartShowDates);

    Plot( C, “Close”, ParamColor(“Color”, colorBlack ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );

    _N(Title = StrFormat(“{{NAME}} -- {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}”, O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));

    PositionSize = 100000;

    Factor=Optimize(“Factor”,3,2,10,1);
    Pd=Optimize(“ATR Periods”,10,1,20,1);
    Up=(H+L)/2+(Factor*ATR(Pd));
    Dn=(H+L)/2-(Factor*ATR(Pd));
    iATR=ATR(Pd);
    TrendUp=TrendDown=Null;
    trend[0]=1;
    changeOfTrend=0;
    flag=flagh=0;

    for (i = 1; i Up[i-1]) {
    trend[i]=1;
    if (trend[i-1] == -1) changeOfTrend = 1;

    }
    else if (Close[i]<Dn[i-1]) {
    trend[i]=-1;
    if (trend[i-1] == 1) changeOfTrend = 1;
    }
    else if (trend[i-1]==1) {
    trend[i]=1;
    changeOfTrend = 0;
    }
    else if (trend[i-1]==-1) {
    trend[i]=-1;
    changeOfTrend = 0;
    }

    if (trend[i]0) {
    flag=1;
    }
    else {
    flag=0;
    }

    if (trend[i]>0 && trend[i-1]0 && Dn[i]<Dn[i-1]){
    Dn[i]=Dn[i-1];
    }

    if (trend[i]Up[i-1])
    { Up[i]=Up[i-1];
    }

    if (flag==1)
    { Up[i]=(H[i]+L[i])/2+(Factor*iATR[i]);;
    }
    if (flagh==1)
    { Dn[i]=(H[i]+L[i])/2-(Factor*iATR[i]);;
    }
    if (trend[i]==1) {
    TrendUp[i]=Dn[i];
    if (changeOfTrend == 1) {
    TrendUp[i-1] = TrendDown[i-1];
    changeOfTrend = 0;
    }
    }
    else if (trend[i]==-1) {
    TrendDown[i]=Up[i];
    if (changeOfTrend == 1) {
    TrendDown[i-1] = TrendUp[i-1];
    changeOfTrend = 0;
    }
    }
    }

    Plot(TrendUp,”Trend”,colorGreen);
    Plot(TrendDown,”Down”,colorRed);

    Buy = trend==1;
    Sell=trend==-1;

    Buy=ExRem(Buy,Sell);
    Sell=ExRem(Sell,Buy);
    Short=Sell;
    Cover=Buy;

    BuyPrice=ValueWhen(Buy,C);
    SellPrice=ValueWhen(Sell,C);
    ShortPrice=ValueWhen(Short,C);
    CoverPrice=ValueWhen(Cover,C);

    Title = EncodeColor(colorWhite)+ “Super Trend AFL code from https://www.marketcalls.in” + ” -- ” + Name() + ” -- ” + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +
    ” -- ” + Date() +” -- “+”
    ” +EncodeColor(colorRed) +”Op-“+O+” “+”Hi-“+H+” “+”Lo-“+L+” “+
    “Cl-“+C+” “+ “Vol= “+ WriteVal(V)+”
    “+
    EncodeColor(colorLime)+
    WriteIf (Buy , ” GO LONG / Reverse Signal at “+C+” “,””)+
    WriteIf (Sell , ” EXIT LONG / Reverse Signal at “+C+” “,””)+”
    “+EncodeColor(colorYellow)+
    WriteIf(Sell , “Total Profit/Loss for the Last Trade Rs.”+(C-BuyPrice)+””,””)+
    WriteIf(Buy , “Total Profit/Loss for the Last trade Rs.”+(SellPrice-C)+””,””);

    PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
    PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
    PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
    PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
    PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
    PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

    TrendSL=IIf(trend==1,TrendUp,TrendDown);

    for(i=BarCount-1;i>1;i--)
    {
    if(Buy[i] == 1)
    {
    entry = C[i];
    sig = “BUY”;
    sl = TrendSL[i];
    tar1 = entry + (entry * .0050);
    tar2 = entry + (entry * .0092);
    tar3 = entry + (entry * .0179);

    bars = i;
    i = 0;
    }
    if(Sell[i] == 1)
    {
    sig = “SELL”;
    entry = C[i];
    sl = TrendSL[i];
    tar1 = entry -- (entry * .0050);
    tar2 = entry -- (entry * .0112);
    tar3 = entry -- (entry * .0212);

    bars = i;
    i = 0;
    }
    }
    Offset = 20;
    Clr = IIf(sig == “BUY”, colorLime, colorRed);
    ssl = IIf(bars == BarCount-1, TrendSL[BarCount-1], Ref(TrendSL, -1));
    sl = ssl[BarCount-1];

    Plot(LineArray(bars-Offset, tar1, BarCount, tar1,1), “”, Clr, styleLine|styleDots, Null, Null, Offset);
    Plot(LineArray(bars-Offset, tar2, BarCount, tar2,1), “”, Clr, styleLine|styleDots, Null, Null, Offset);
    Plot(LineArray(bars-Offset, tar3, BarCount, tar3,1), “”, Clr, styleLine|styleDots, Null, Null, Offset);

    //Plot(LineArray(bars-Offset, sl, BarCount, sl,1), “”, colorDarkRed, styleLine|styleLine, Null, Null, Offset);
    //Plot(LineArray(bars-Offset, entry, BarCount, entry,1), “”, colorGreen, styleLine|styleLine, Null, Null, Offset);

    for (i=bars; i <BarCount;i++)
    {
    PlotText(""+sig+"@"+entry, BarCount+1,entry,Null,colorBlue);
    PlotText("T1@"+tar1,BarCount+3,tar1,Null,Clr);PlotText("T2@"+tar2,BarCount+3,tar2,Null,Clr);PlotText ("T3@"+tar3,BarCount+3,tar3,Null,Clr);

    }

    messageboard = ParamToggle("Message Board","Show|Hide",1);
    if (messageboard == 1 )
    {
    GfxSelectFont( "Tahoma", 13, 100 );
    GfxSetBkMode( 1 );
    GfxSetTextColor( colorWhite );

    if ( sig =="BUY")
    {
    GfxSelectSolidBrush( colorBlue ); // this is the box background color
    }
    else
    {
    GfxSelectSolidBrush( colorRed ); // this is the box background color
    }
    pxHeight = Status( "pxchartheight" ) ;
    xx = Status( "pxchartwidth");
    Left = 1100;
    width = 310;
    x = 5;
    x2 = 290;

    y = pxHeight;

    GfxSelectPen( colorGreen, 1); // broader color
    GfxRoundRect( x, y -- 98, x2, y , 7, 7 ) ;
    GfxTextOut( ( "Marketcalls -- Supertrend"),13,y-100);
    GfxTextOut( (" "),27,y-100);
    GfxTextOut( ("Last " + sig + " Signal came " + (BarCount-bars-1) * Interval()/60 + " mins ago"), 13, y-80) ; // The text format location
    GfxTextOut( ("" + WriteIf(sig =="BUY",sig + " @ ",sig + " @") + " : " + entry), 13, y-60);
    GfxTextOut( ("Trailing SL : " + TrendSL + " (" + WriteVal(IIf(sig == "SELL",entry-sl,sl-entry), 2.2) + ")"), 13, y-40);
    /*GfxTextOut( ("TGT:1 : " + tar1), 13, y -80);
    GfxTextOut( ("TGT:2 : " + tar2), 13,y-60);
    GfxTextOut( ("TGT:3 : " + tar3), 13,y-40);*/
    GfxTextOut( ("Current P/L : " + WriteVal(IIf(sig == "BUY",(C-entry),(entry-C)),2.2)), 13, y-22);;

    }

    _SECTION_END();

    Reply
  52. P. SHAILU says

    May 9, 2012 at 11:33 pm

    HI

    SEE THIS IMAGE FOR AMI BROKER V. 5.1

    Reply
  53. P. SHAILU says

    May 15, 2012 at 11:56 am

    SIR I WANT ONE MORE HELP FROM YOU. AS I TOLD YOU I DID LITTLE BIT EDITING OF YOUR BOTH SUPER TREND VERSIONS FOR BORD DISPLAY BUT FOR THE LOWER VERSION IT SHOWS NOTHING IN PARAMETER BOX SO IF I HAVE TO CHANGE ATR LINE OR MULTIPLIER I HAVE TO GO TO AFL CANT EDIT IT FROM PARAMETERS WINDOW PLS HELP … OR DO REPLY A.S.A.P.

    THNX IN ADVANCE

    Reply
  54. Korath Kurian says

    June 7, 2012 at 10:42 am

    Hi Rajendran,

    Am new to intraday trading in Nifty futures and Bank Nifty futures.
    Been watching your Super Trend live charts. ( not working today though !)
    Am very impressed with the results. How can I get this onto y desktop?
    Am on icicidirect Traderacer.

    Advance thanks, best regards.

    Reply
    • Rajandran R says

      June 7, 2012 at 11:02 am

      @Korath Kurian

      Its working! you can watch the trading activity here
      https://www.marketcalls.in/livecharts

      Reply
  55. Korath Kurian says

    June 7, 2012 at 3:13 pm

    Thanks. Got the site.

    Can something like this be configured in icicidirect Traderacer software?

    Reply
    • Rajandran R says

      June 7, 2012 at 3:35 pm

      no it is a custom indicator and traderacer software doesnt has that option

      Reply
  56. Mithoon says

    July 17, 2012 at 4:28 pm

    SUPER!!!!

    Reply
  57. Ram says

    July 19, 2012 at 1:43 pm

    Dear Rajandran,

    Very much inspired by your work and the help you are providing to all. I m new to the amibroker and I have version 5.2. I downloaded the .afl from this page, but after running the same, I m not able to get the same kind of graph which you have mentioned or the one that is shown in the youtube. Can you pls send me the .afl code to my mail address, dotone555@gmail.com. Thanks in advance.

    Regards
    Ram

    Reply
  58. Swetal Shah says

    July 22, 2012 at 12:58 pm

    Hi,

    I would want to use this AFL code in my newly purchased Amibroker software.
    Sorry to bother but can some one reply or email (swetalshah99@gmail.com) on how to add this .zip file or any other AFL code (.txt) into my Amibroker and start using / testing it?
    I would highly appreciate your support / help in this regard.

    Thanks.
    Swetal

    Reply
  59. yogesh says

    July 23, 2012 at 12:44 pm

    Hi Rajandran,

    Super trend is working fine with MT platform. I have one query, can we predict a trend, either up or down, will go for a long time so that we can put our position in that to get maximum return. OR can we get signal of trend reversal few sticks earlier so that we can close out current position and quit so that we could not trap in reverse trend, losing our profit. If yes please tell.

    Thank you for super SUPERTREND

    Yogesh

    Reply
    • Rajandran R says

      July 23, 2012 at 1:37 pm

      Its tough to predict even a structured market in lower timeframes where you dont know when it reacts and when it turns/twists its direction. Its tough to predict a sideways market though prediction tools like Elliot Wave, GANN are available. But the problem is that the risk involved in such system are tough to evaluated.

      Reply
  60. arjun says

    July 23, 2012 at 7:24 pm

    @ Swetal
    From your amib upper tool bar click on ‘Formula Editor’ ( icon resembles hammer) and just copy paste that code from text file and save that AFL to desired sub- folder under Formuals.

    Reply
  61. suraj says

    August 5, 2012 at 10:54 pm

    Hi
    please tell me how to install amibroker and how to add AFL and after done all things, how to run real time data free as can do in mt4..

    hope you will guide me step by step

    Thanks

    Reply
  62. Rakesh says

    August 6, 2012 at 12:02 am

    Very very thanks Rajandra for your code. I have recently purchased Amibroker Professional and made and tried many system, But today i found your super trend and I visualize it on 3-min IEOD data of Nifty future and found excellent.

    But when I back tested I found it giving negative results can you please tell me what position size, periodicity and equity, margin and brokerage to be used when backtesting to get original results as we see in the charts.

    I am going to trade your system for next month and I am sure will get huge profit, obviously with my own risk.

    Once again very thanks for your help.

    Rakesh

    Reply
  63. shwetha says

    August 17, 2012 at 10:55 am

    hi mr.rajendra am a s/w engg. student i want to learn creating such s/w so can you tell me which programming language and platform used to built Amibroker Software .AFL thanks

    Reply
    • suraj says

      August 18, 2012 at 9:09 am

      Hi All friends
      I just like to know step by step how to install amibroker and after that how to use this indicator and main part that how to get real time data free to run this indicator…

      Hope I will get my solution….

      thaks

      Reply
  64. neeru says

    August 19, 2012 at 3:57 pm

    i wanna to buy supertrend afl software for option and mcx…………plz tell me from where and with charges……….

    Reply
  65. TAM says

    August 19, 2012 at 5:43 pm

    Average True Range (ATR)
    Introduction

    Developed by J. Welles Wilder, the Average True Range (ATR) is an indicator that measures volatility. As with most of his indicators, Wilder designed ATR with commodities and daily prices in mind. Commodities are frequently more volatile than stocks. They were are often subject to gaps and limit moves, which occur when a commodity opens up or down its maximum allowed move for the session. A volatility formula based only on the high-low range would fail to capture volatility from gap or limit moves. Wilder created Average True Range to capture this “missing” volatility. It is important to remember that ATR does not provide an indication of price direction, just volatility.

    Wilder features ATR in his 1978 book, New Concepts in Technical Trading Systems. This book also includes the Parabolic SAR, RSI and the Directional Movement Concept (ADX). Despite being developed before the computer age, Wilder’s indicators have stood the test of time and remain extremely popular.
    True Range

    Wilder started with a concept called True Range (TR), which is defined as the greatest of the following:

    Method 1: Current High less the current Low
    Method 2: Current High less the previous Close (absolute value)
    Method 3: Current Low less the previous Close (absolute value)

    Absolute values are used to ensure positive numbers. After all, Wilder was interested in measuring the distance between two points, not the direction. If the current period’s high is above the prior period’s high and the low is below the prior period’s low, then the current period’s high-low range will be used as the True Range. This is an outside day that would use Method 1 to calculate the TR. This is pretty straight forward. Methods 2 and 3 are used when there is a gap or an inside day. A gap occurs when the previous close is greater than the current high (signaling a potential gap down or limit move) or the previous close is lower than the current low (signaling a potential gap up or limit move). The image below shows examples of when methods 2 and 3 are appropriate.

    ATR -- True Range Image

    Example A: A small high/low range formed after a gap up. The TR equals the absolute value of the difference between the current high and the previous close.

    Example B: A small high/low range formed after a gap down. The TR equals the absolute value of the difference between the current low and the previous close.

    Example C: Even though the current close is within the previous high/low range, the current high/low range is quite small. In fact, it is smaller than the absolute value of the difference between the current high and the previous close, which is used to value the TR.
    Calculation

    Typically, the Average True Range (ATR) is based on 14 periods and can be calculated on an intraday, daily, weekly or monthly basis. For this example, the ATR will be based on daily data. Because there must be a beginning, the first TR value is simply the High minus the Low, and the first 14-day ATR is the average of the daily TR values for the last 14 days. After that, Wilder sought to smooth the data by incorporating the previous period’s ATR value.

    Current ATR = [(Prior ATR x 13) + Current TR] / 14

    -- Multiply the previous 14-day ATR by 13.
    -- Add the most recent day’s TR value.
    -- Divide the total by 14

    ATR -- Spreadsheet

    Click here for an Excel Spreadsheet showing the start of an ATR calculation for QQQQ.

    In the Spreadsheet example, the first True Range value (.91) equals the High minus the Low (yellow cells). The first 14-day ATR value (.56)) was calculated by finding the average of the first 14 True Range values (blue cell). Subsequent ATR values were smoothed using the formula above. The spreadsheet values correspond with the yellow area on the chart below. Notice how ATR surged as QQQQ plunged in May with many long candlesticks.

    ATR -- Chart 1

    For those trying this at home, a few caveats apply. First, ATR values depend on where you begin. The first True Range value is simply the current High minus the current Low and the first ATR is an average of the first 14 True Range values. The real ATR formula does not kick in until day 15. Even so, the remnants of these first two calculations linger to slightly affect ATR values. Spreadsheet values for a small subset of data may not match exactly with what is seen on the price chart. Decimal rounding can also slightly affect ATR values.
    Absolute ATR

    ATR is based on the True Range, which uses absolute price changes. As such, ATR reflects volatility as absolute level. In other words, ATR is not shown as a percentage of the current close. This means low priced stocks will have lower ATR values than high price stocks. For example, a $20-30 security will have much lower ATR values than a $200-300 security. Because of this, ATR values are not comparable. Even large price movements for a single security, such as a decline from 70 to 20, can make long-term ATR comparisons impractical. Chart 4 shows Google with double digit ATR values and chart 5 shows Microsoft with ATR values below 1. Despite different values, their ATR lines have similar shapes.

    ATR -- Chart 4

    ATR -- Chart 5
    Conclusions

    ATR is not a directional indicator, such as MACD or RSI. Instead, ATR is a unique volatility indicator that reflects the degree of interest or disinterest in a move. Strong moves, in either direction, are often accompanied by large ranges, or large True Ranges. This is especially true at the beginning of a move. Uninspiring moves can be accompanied by relatively narrow ranges. As such, ATR can be used to validate the enthusiasm behind a move or breakout. A bullish reversal with an increase in ATR would show strong buying pressure and reinforce the reversal. A bearish support break with an increase in ATR would show strong selling pressure and reinforce the support break.
    SharpCharts

    Listed as “Average True Range”, ATR is on the Indicators drop-down menu. The “parameters” box to the right of the indicator contains the default value, 14, for the number of periods used to smooth the data. To adjust the period setting, highlight the default value and enter a new setting. Wilder often used 8 period ATR. SharpCharts also allows users to position the indicator above, below, or behind the price plot. A moving average can be added to identify upturns or downturns in ATR. Click “advanced options” to add a moving average as an indicator overlay. Click here for a live example of ATR.

    Reply
  66. Kanwar says

    September 1, 2012 at 12:56 pm

    I have Amibroker 5.5 and Super trend AFL.IT work fine i can see buy sell signal But It shows Error 29 when i scan..so i am not able to scan the signal at right time can you please help how to rectify that?
    thanks in advance

    Reply
    • Rajandran R says

      September 1, 2012 at 11:16 pm

      your scan will file is any of the stock dont have sufficient data. otherwise you need to remodify the accordingly.

      Reply
  67. nileysh sane says

    September 23, 2012 at 9:01 pm

    Hi,
    Sir in sacnning supper trend i am getting error like }

    }

    Offset = 20;

    Clr = IIf(sig =
    ————--^

    Error 29.
    Variable ‘sig’ used without having been initialized.

    How can i solve this pls explain me.

    Thanx

    Reply
  68. Mithoon says

    October 5, 2012 at 6:35 pm

    Couls you please advice on how to code for exiting all open position by eod ,i was given
    no_trading = TimeNum() > 152000;
    Buy = ..your rules AND NOT no_trading;
    Sell = ..your rules… OR no_trading;
    But it does not work,any suggestions?

    Reply
    • Rajandran R says

      October 6, 2012 at 9:55 am

      @mithoon

      try this one

      tradingtime = TimeNum() < 152000; exittime = TimeNum() > 152000;
      Buy = ..your rules AND tradingtime;
      Sell = ..your rules… OR exittime

      Reply
  69. ash says

    November 10, 2012 at 1:14 pm

    Hi Raj

    Installed your super trend today, the first time when manshi rt opened amibroker it showed the box on the left side where you inform last buy/sell call sl etc. I closed amibroker lot of pain went in actually getting odin data in amibroker and finally data came in to amibroker. Your buy sell is also appearing for previous day. But today (saturday) is not getting updated.

    My question is does your code not work on Saturday ??. Does it work only on weedays? Also I am trying to use your indicator for commodities, will that be a problem?

    I also have another question, is it not possible for your code logic to be somehow put directly in ODIN?

    Reply
  70. shrividhya s says

    November 26, 2012 at 3:39 pm

    Hi,

    Can the Code of AFL be decoded to EXCELL SPREADSHEETs……

    Reply
    • Rajandran R says

      November 27, 2012 at 2:34 pm

      @Shrividhya
      Yes it can be done.

      Reply
  71. Mani Gupta says

    December 11, 2012 at 8:18 pm

    Error 29: variable ‘entry’ used without having been initialsed.. Line 217 column 75 showing error sir.. can u help

    GfxTextOut( (“Current P/L : ” + WriteVal(IIf(sig == “BUY”,(C-entry),(entry-C)),2.2)), 13, y-22);;

    Reply
  72. lalitkumar says

    December 11, 2012 at 10:09 pm

    please give me the correct afl for supertrend . bec currently i see the image for supper trend …. stop loss are not correct …

    example : sell 540 tr 530 sl 542 this is correct

    currently i see the sell trade sell 540 tr 530 sl 538

    ????

    Reply
    • Rajandran R says

      December 12, 2012 at 11:14 am

      you can find the code update here. But still code has been tested by thousand of people amibroker and it is working fine

      Non Repainting Super Trend Indicator with Time Bar Left AFL code

      Reply
  73. Mani Gupta says

    December 12, 2012 at 3:26 pm

    This is the image of the problem i’m facing.. plz help me out..

    http://imgur.com/3fy67

    http://imgur.com/gEHd7

    Plz tell me where my system is going wrong..

    Reply
    • Rajandran R says

      December 13, 2012 at 4:59 pm

      Hi,

      Look into our backtesting video on how to use it

      Reply
  74. Mani Gupta says

    December 12, 2012 at 4:03 pm

    I’m using manshiRT demo for data & having 5 days of backfill data.. used with all the commodities same error showing.. Or u can explain any method of using the afl as I haven’t used any before..

    Reply
  75. shrisha says

    December 12, 2012 at 5:51 pm

    I tried the supertrend AFL Code,but i do get error of entry variable not initialized

    I went through the forum there was not solution given to that problem 🙁

    version : 5.6 latest

    Reply
  76. Mani Gupta says

    December 13, 2012 at 11:17 pm

    I’m also using Amibroker 5.6.. there is no solution anywhere.. I have given the images of the error.. plz sort it out.. nothing is helping.. plz enlighten.. Ur video above is only showing bar replay..
    Is there any other video which can help in this error.. plz give d link..

    Reply
    • Rajandran R says

      December 13, 2012 at 11:58 pm

      @Mani Gupta

      Try this out
      https://www.marketcalls.in/amibroker/how-to-backtest-supertrend-strategy-for-nifty-futures-using-amibroker.html

      Reply
  77. ashu says

    December 28, 2012 at 10:03 pm

    Hi Raj

    first of all god bless you for coming up the afl code, i know as you said accuracy is about 42% or whatever the figure is, however i just want to say that now either i get out at cost or maybe 1 or 2 ticks above my cost either way i am not losing money. earlier i used to take heavy losses now atleast my losses have come down. god bless u once again. making money is in your fate, if i make good if i dont its not fate, but with ur afl code atleast i wont lose a lot.

    Reply
  78. veeresham says

    January 8, 2013 at 4:40 pm

    Sir,
    The Super Trend AFL code is it valid only for intraday using Amibroker? Can you provide Super Trend AFL code for Short Term(1-3 weeks) and long term (1-3 months) Periods. Iam very much thankful to you.

    Reply
  79. ashu says

    January 14, 2013 at 7:10 pm

    can you tell me what to change in afl code to make non repainting to repainting,

    Reply
  80. anurag saini says

    January 21, 2013 at 3:04 pm

    i want to configure super trend in amibroker 5.6 plz tell me how to do it

    Reply
  81. rajesh says

    March 5, 2013 at 7:55 pm

    SIR, At present i am using ticker plants super trend, in which multiplier is 3 and period is 10.would you suggest 2 and 11 instead of 3 and 10.

    Reply
    • Rajandran R says

      March 5, 2013 at 9:40 pm

      we use 3 and 7 for for Nifty and Bank nifty and rest for stocks and Commodities we prefer 4 and 10.

      Reply
  82. ducanh says

    March 6, 2013 at 1:18 pm

    Thank Rajandran for the useful code of super trend. Sir, when I used the function “new analysis” to scan the categories, an error, namely “Error 29. Variable ‘entry’ used without having been initialized. (Ln: 217,Col:75) ocurred. I used “Non Repainting Super Trend Indicator” for Amibroker, version 5.5. Please help me correct the error. Many thanks.

    Reply
  83. deepak says

    March 7, 2013 at 6:24 pm

    any FREE softwer live data provider

    Reply
  84. K.M. Ravichandran says

    March 11, 2013 at 8:19 pm

    Sir, I am Ravi from Erode, I like your amibroker chart. I like to contact you I want your cell No. Please reply immediately.

    Reply
  85. Dick Hoierman says

    March 14, 2013 at 11:56 pm

    I ran into your program on the AB Yahoo Group site but it was not your entire version but one posted by Ed Pottasch. I am not a day traded but a EOD trader. The formula appeared to target changes in Trend which I want to use as trade signals in trading ETF’s long/short (pairs trading) . There are over 100 Long/Short ETF Pairs.
    I would appreciate if you could send me the necessary changes to the program so it will work on a EOD basis. I especially like the PopUP (red) but it is useless with current time periods so a change to daily would be most appreciated. Thanks
    Dick

    Dick

    Reply
  86. piyush says

    March 18, 2013 at 6:39 pm

    rajandran ji,

    i backtested u superfrend on hourly on currect data. the backtest report gives sell whereas in chart its a buy. i had mailed u too abt the problem. how to solve it
    http://postimage.org/gallery/ah378v7e/

    Reply
  87. Hoierman says

    March 19, 2013 at 10:06 pm

    Raj,
    This is in follow up to my recent post. I find the Super Trend formula (without the red message board and black background to be more accurate on trend Buy/Sell arrows than the aforementioned newer one. This is based on the long/short silver ETF’s (USLV & DSLV) Why so? As I presume same basic formula used.
    I do like the “Message board” box but would like to get version (tell me how to change) so that daily time period rather than minutes or seconds. Your help on this will be most appreciated. Thanks

    Dick Hoierman
    areehoi@yahoo.com

    Reply
    • Rajandran R says

      March 20, 2013 at 11:09 am

      HI Dick Hoierman,

      Which Amibroker version you are using. If you are using less than 5.4 then the supertrend code wont support dashboard

      Rajandran R

      Reply
  88. Hoierman says

    March 20, 2013 at 6:20 pm

    Thanks Raj,
    I’m using 5.60.3 version … which works fine. Will look forard to Dashboard for Daily.

    Dick

    Reply
  89. vin says

    April 5, 2013 at 8:48 am

    Your super trend formula for amibroker is excellent -- the only drawback for me is that it is an automated formula system, and also to change the parameters I have to use the edit function. It would be great if you can make a minor modification wherein we can change the settings in the parameters menu. Unfortunately I am not skilled in programming.
    I would also like to know how to plot only the lines of the supertrend on to the price chart itself with an ability to change the parameters from the parameter menu

    Reply
  90. vin says

    April 5, 2013 at 1:37 pm

    OOps , I am using the older version of the code, but I would still like to plot only the lines on the bar charts. please do help.
    thank you,
    vin

    Reply
  91. s says

    April 10, 2013 at 2:11 am

    how to solve error 29 veriabl entry used without having been initialized
    plz help me

    Reply
  92. Ravi says

    May 1, 2013 at 11:23 pm

    Dear Raj,
    You are Outstanding man!!!!I am soft engineer and i was just trying to understand the Super Trend AFL code it is fantastically presented but I have one doubt in you code basically i was just trying out first in Excel by creating same set of variables you have created in it. The only doubt I am having is while initializing the values of first time againt Dn and UP variable what should I set also similarly what should be initialize value for Dn-1 and Up-1 since there will not be any values against it. I would appreciate if you help me out in resoving thsi issue. If need I can attache my excel sheet …..pls help!!!

    Reply
    • Rajandran R says

      May 3, 2013 at 10:10 am

      Intial Values are obviously NULL Values

      Reply
  93. Mukund says

    May 17, 2013 at 12:26 am

    Sir,
    I have checked this afl for current nifty future. This is not working now (going in loss). Can you tell me why it is now not working?

    Thanks in advance.

    Reply
  94. Akhilesh says

    June 27, 2013 at 11:45 pm

    Hi Rajandran,

    The code gives an error at line 217 col 75 that “entry” is not initialized. Could you please let me know the fix for it??
    Thanks for advance!!

    Reply
    • Rajandran R says

      June 28, 2013 at 11:27 am

      Make sure that you are using amibroker ver above 5.4 and suffcicient backfill data atleast 50 candles are required to plot the indicator

      Reply
  95. Amul Pandya says

    June 30, 2013 at 4:12 am

    You are a great guy helping us. Your backtesting shows results for futures, Can I use the same AFL for options data ? Would it have the similar results ? What will be the changes I would have to make to the AFL script, if any ?

    Reply
  96. Sriharish says

    July 11, 2013 at 11:14 am

    Hello Friends, Can some one help me on how to add this AFL indicator to Amibroker please ?

    Reply
  97. mitesh panchal says

    July 23, 2013 at 12:43 am

    I”m getting below error. Can you please help
    (I’m using amibroker 5.4 rc2 version)

    Reply
  98. mitesh panchal says

    July 23, 2013 at 12:47 am

    I’m getting below error. please help. I’m using amibroker 5.4 rc2 version.

    Error 29.
    Variable ‘sig’ used without having been initialized.

    Reply
    • Rajandran R says

      July 23, 2013 at 10:38 am

      @Mithesh Pachal : Can you try with Ami 5.5 version. I think Ami 5.4 rc2 also wont support it

      Reply
  99. Kannan says

    July 26, 2013 at 9:41 am

    Raj, I tried the supertrend strategy on Nifty 5Mins for the period August 2012 to July 2013 with the same parameter of 2 and 11. The strategy has lost 8% during this period against 11% gain on Nifty (this is excluding the cost). I also tried with Nifty 60 Mins and Gold 60 and 5 Mins, the results are not satisfactory as the strategy lost money in most cases. Does this strategy really work? Has any one traded on live basis and made money? How can I improvise the strategy so that it really makes money in real trading.

    Reply
    • Rajandran R says

      July 26, 2013 at 10:53 am

      @Kannan : The Finetuned parameters for Nifty futures is 3 and 7 in 5min. And backtest should be done with atleast with 2-3 years of data to look into the actual result. with three or four month of backtesting we can judge the entire strategy performance.

      Reply
      • Kannan says

        July 26, 2013 at 12:38 pm

        @ Raj, may be my trade logic needs to be corrected. I buy when current close is greater than previous supertrend value and vice versa for sell; no stop as it a toggle. Is this logic correct? Also, what is the optimized parameters for Nifty 60Mins?

        Reply
        • Rajandran R says

          July 26, 2013 at 2:45 pm

          @Kannan : Logic is clear trailing stop is based on the close value not based on the intra candles.

          Reply
  100. Pravin M says

    July 26, 2013 at 7:28 pm

    hii,
    what is default name of the array used for storing the price’s of intraday stocks ? So i can use it while coding my strategies. I know I am asking very basic question but I am quite new to use this.Please help me.

    Reply
  101. Amul says

    July 26, 2013 at 10:41 pm

    I saw your backtesting results for NIFTY Future. At what price do you book the profits in the backtesting ? Do you book first lot at first target and second lot at trailing stop loss ?

    Reply
    • Rajandran R says

      July 26, 2013 at 11:20 pm

      Its arrow to arrow.

      Reply
  102. Priya says

    September 4, 2013 at 9:44 pm

    Dear Raj sir,

    Thnks a lot very much for your supertrend.
    I tried back testing MCX crude oil with your back testing video reference for the five months data in 2010 but its giving negative results.May be i m doing some wrong can you pls asssit me in this or is it possbile for you to share the back test results.

    Regards
    Priya

    Reply
  103. Kannan says

    September 6, 2013 at 5:31 pm

    Hi Raj,
    In the newer version, your magnified market price is behind the background. Is it because of the layer? How can i bring it to front? Also, your message box is invisible. Do the code need to be update incorporating the zorder? How can this be displayed? Pls suggest.

    Reply
    • Rajandran R says

      September 6, 2013 at 5:45 pm

      You need to go to Tool->Preferences->Axis and uncheck all the options that will do

      Reply
  104. SHANKAR says

    September 13, 2013 at 5:56 pm

    Dear Mr.Rajendran,
    I would like to Buy AMIBROKER software and also I need SUPER TREND . Will you help me in this regards. I look forward your favourable reply at the earliest.

    Kind regards,
    Shankar,

    Reply
    • Rajandran R says

      September 14, 2013 at 10:37 am

      @Shankar : Sent you the details in mail

      Reply
  105. siddesh TM says

    September 18, 2013 at 11:27 am

    i have amibroker,i want super trend to trade in nifty/banknifty,please send me details,

    HARE KRISHNA
    Siddesh TM
    9900162253

    Reply
  106. arbind says

    September 27, 2013 at 8:39 pm

    i m unabel to display messageboard in SuperTrend plz help

    Windows 7
    Amibroker 5.60.2

    Reply
    • Rajandran R says

      September 27, 2013 at 10:56 pm

      Arbind

      Goto Tools->Prefrences->Axes and uncheck all the boxes. Problem will be rectified

      Reply
      • arbind says

        September 28, 2013 at 4:36 pm

        Yes I have done as you mention Axes/Grids And Uncheck all The Option still it is not showing Messageboard

        Reply
  107. RoshanRJ says

    October 18, 2013 at 8:41 pm

    Dear Mr.Rajendran,
    Even I would like to Buy AMIBROKER software and also I need SUPER TREND . Will you help me in this regards. the same msg which Shankar send you before. Pls, I look forward your favourable reply at the earliest.

    Reply
  108. Raj says

    October 21, 2013 at 1:10 pm

    Dear Rajendran,

    Can you please share me the super trend excel formula.
    I would like to calculate it thru excel. Please help me.

    Reply
    • Rajandran R says

      October 21, 2013 at 4:26 pm

      Hi,

      Iam not a hardcore excel user. I do most of my stuff with amibroker software.

      Reply
  109. SIVA says

    October 27, 2013 at 11:26 am

    Dear Mr.Rajendran,
    I would like to Buy AMIBROKER software and also I need SUPER TREND . Will you help me in this regards. I look forward your favourable reply at the earliest.

    Kind regards,
    SIVA

    Reply
  110. Amar says

    March 13, 2014 at 4:13 pm

    Dear Mr Rajendran
    can you please explain me how to interpret super trend for old amibroker

    Reply
    • Rajandran R says

      March 13, 2014 at 6:16 pm

      Hi,

      The old Supertrend is for the users having amibroker version 5.3 and less than that. The interpretation is same as that of the one running in our NSE Futures livecharts section

      Reply
      • amar says

        March 13, 2014 at 8:27 pm

        Sir thank you for your reply
        what i want to know is when i am running analyzer for old super trend using EOD data, 98% of buy signals given are turning in to loss makers, some times loss is beginning in the very next trade itself.
        I am using amibroker 5.0

        Reply
        • Rajandran R says

          March 13, 2014 at 9:35 pm

          @Amar : Supertrend is ideal for Lower Timeframes and also the backtest procedures are different. To Learn how to backtest supertrend strategy visit here http://www.youtube.com/watch?v=0rKw5DO1s8c

          Reply
  111. srikanth says

    March 22, 2014 at 12:59 am

    really very very very very gr8 Rajandran R. may got bless u sir.

    Reply
  112. abdulaziz says

    April 10, 2014 at 12:14 pm

    Dear Mr Rajendran

    can I use it with stockes , and what is the best frame for it.

    Reply
    • Rajandran R says

      April 10, 2014 at 3:31 pm

      The system is designed and optimized for Nifty and Banknifty

      Reply
  113. Akhilesh says

    April 27, 2014 at 8:42 pm

    Hi Rajendran,

    I have modified the Super trend, and signals are reversed if the High/Low touches the TrendUp/TrendDown line. I have done this to achieve 2 things.

    a) Reducing the Slippage (As the Stoploss order is already with server and there is no delay when the signal is generated and order execution. This is helpful in volatile markets.)

    b) I can trade multiple scripts at the same time as my automated trading system will not work when the multiple orders are generated at the same time.

    Further some of the features are:
    1) I am using the ATR -6 and Multiplier-4 and 10 min TF

    2) I keep trailing the Stoploss as mentioned in step 1.

    3) My setup is fully automated and runs on the VPS.

    Last 3 months I am not getting good results. I would like to know if I am doing anything wrong?
    Can you share the performance of the ST used by you for last 3 months?

    Reply
  114. Nehal Suthar says

    May 28, 2014 at 11:21 am

    hi, i was looking at eod section (https://www.marketcalls.in/eodcharts) on your website and for hourly nifty chart, it says “intra trend afl code from https://www.marketcalls.in” on the top left corner of the chart. could you please tell me if this afl is different than super trend afl code? thanks in advance.

    Reply
  115. bharat says

    June 4, 2014 at 6:58 pm

    I want only last trade signals in Alert Output window.I am using following code.But it is not giving desired results.Pl. see image and correct the code.
    barcomplete = BarIndex() < LastValue(BarIndex());

    AlertIf( barcomplete AND (Buy OR Short), "", "Text", 1+8 );

    regards

    bharat

    Reply
    • Rajandran R says

      June 4, 2014 at 8:30 pm

      try with the flags 1+4+8 i guess that should work.

      Reply
  116. anil says

    July 16, 2014 at 2:36 pm

    Hello Rajandran sir can you please share the exploration code for supertrend indicator

    Reply
    • Rajandran R says

      July 18, 2014 at 2:40 am

      Will try it out when time permits.

      Reply
  117. shahbaz says

    August 14, 2014 at 10:09 pm

    Sir could you please give SuperTrend Afl with settings of 10 & 4. Please i need it very urgently.
    Thanks

    Reply
    • Rajandran R says

      August 17, 2014 at 9:20 am

      Hi you can download the fresh code from here https://www.marketcalls.in/amibroker/supertrend-multitimeframe-dashboard-amibroker-afl-code.html with 10 and 4 as default settings.

      Reply
  118. prem says

    August 20, 2014 at 9:44 am

    sir i download it for super trend my amibroker eror 42 is show how t instel this plz help me

    Reply
    • Rajandran R says

      August 20, 2014 at 11:39 am

      Make sure you have enough historical data and you are trying with amibroker v5.5 or above.

      Reply
  119. Azar says

    November 9, 2014 at 8:06 pm

    Hello. How to install metatreader4 Super Trend Indicator

    Reply
  120. OT says

    December 13, 2014 at 11:31 am

    Hi Raj, Thanks for the knowledge you are sharing.
    can i please request you to share the super trend logic, so i can transform the same in TradeScript -- modulus code.

    Please let me know at the earliest. Apologies if you dont want to share.

    Reply
    • Rajandran R says

      December 13, 2014 at 2:17 pm

      The logic is there in the Amibroker Code itself. Tradescript and AFL is more or less same both uses Vector language.

      Reply
  121. Sameer Chaturvedi says

    March 8, 2015 at 10:17 pm

    Dear Sir,

    as i have mentioned in previous mail that i m now trading with Super trend V3 and trading in Nifty only --not even bank nifty . As of now my losses are stopped now and started covering my lost money . I am trading with Robo Trader with your Afl. My trading style is whenever signal comes my robo execute the order and when 0.55% price moves it books 50% profit (2 LOTS OF NIFTY) and remaining 50% with trailing stop loss of 0.50%.

    thanx a lot for this afl

    my query is this that youn mentioned in someones reply of 22nd may 2014 that you will soon bring an or working on to minimize the carry forward risk . If you have done so then pls send the same link pls .

    second thing ….is the trend blaster is something different i mean can be used for stocks and if you have that kindly send the link .

    thnx in advance

    sameer chaturvedi

    Reply
  122. kiran marthak says

    April 15, 2015 at 11:21 am

    How to solve “Variable “entry” used without having been initialized in intraday

    GfxTextOut( (“Current P/L : ” + WriteVal(IIf(sig == “BUY”,(C-entry),(entry-C)),2.2)), 13, y-22);;

    Reply
    • shreyas says

      April 15, 2015 at 2:03 pm

      Dear kiran sir
      I want AFL code as per my technique . can u please help me..please send me ur I’d so I can send u the details.wating for u r reply my I’d -- shreyas4us@ gmail.com

      Reply
      • Rajandran R says

        April 15, 2015 at 5:48 pm

        We are not providing coding as a service at this point of time

        Reply
  123. Siamak says

    July 11, 2015 at 5:46 pm

    Dear Rajandran,

    How can I find sharp growth of stocks for a month?
    I work with daily data. I am looking forward to hearing from you.
    Thanks in advance for your consideration.

    Bests,
    Siamak

    Reply
  124. Deepak says

    November 18, 2015 at 8:59 pm

    when i am using super trend for exploration iam getting following error

    can you please help with this error ” variable ‘trend” used without being initialised.

    Reply
  125. Sanket says

    March 3, 2016 at 4:48 pm

    Hi sir, i m interested in configuring my own robo trading with afl. No matter even if it requires coding for every single scrip. I dont understand how start and configure robo configuration for amibroker

    Reply
  126. vinod says

    June 30, 2019 at 1:31 pm

    kindly tell parmeters of supertrend for commodity and silver

    Reply
    • Rajandran says

      July 12, 2019 at 7:32 pm

      4 and 10 or 3 and 11

      Reply

Leave a Reply to Udit Cancel reply

Your email address will not be published. Required fields are marked *

Email Newsletter

Sign up to receive email updates on latest trading strategies , analysis & financial market updates

We Respect Your Privacy

Premium Access

Username:
Password:
Remember Me
Lost your password?

Tools For Traders

  • Marketcalls Android App
  • MCX Signals
  • Intraday Signals
  • International Commodities
  • OI Tracker
  • Participation OI
  • Your Broker
  • Market Sentiment Analysis

Amibroker Updates

Volatile Phases – Colorful ADX Amibroker AFL Code

November 16, 2019 By Rajandran 4 Comments

Amibroker Technical Analysis Workshop – Bangalore

November 1, 2019 By Rajandran 2 Comments

How to Send Alerts from Amibroker to Telegram Channel using Telgram API

June 12, 2019 By Rajandran 15 Comments

How to Estimate the VWAP based settlement Close like a Pro using Amibroker?

June 9, 2019 By Rajandran Leave a Comment

Practical Approach to Amibroker AFL Coding

May 23, 2019 By Rajandran 37 Comments

  • Facebook
  • Google+
  • LinkedIn
  • RSS
  • Twitter
  • YouTube

Metatrader Updates

MetaTrader 5 Demo Servers Now Available for BSE Currency Markets

March 20, 2018 By Rajandran 8 Comments

ChartIQ – WebTrader for MT4

December 4, 2017 By Rajandran 5 Comments

Metatrader 4 – Web Platform Overview

October 29, 2015 By Rajandran 9 Comments

William VIX FIX Indicator for Metatrader 4

May 16, 2015 By Rajandran 9 Comments

How to Install Custom MQL4 indicators in Metatrader

November 14, 2014 By Rajandran 7 Comments


About | Contact Us | Terms and Conditions | Privacy Policy | Support Policy | Privacy Policy | Refund Policy | Disclaimer


© Copyright 2018 Marketcalls Financial Services Pvt Ltd · All Rights Reserved · And Our Sitemap · All Logos & Trademark Belongs To Their Respective Owners·

Data and information is provided for informational purposes only, and is not intended for trading purposes. Neither marketcalls.in website nor any of its promoters shall be liable for any errors or delays in the content, or for any actions taken in reliance thereon.