Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

70/1030 EMA AFL code for Amibroker

1 min read

Here is a simple logic how to plot 70min/ 1030min EMA in your amiboker software. 70/1030 EMA crossover is a popular strategy witht the yahoo 5min charts. And if your tried with amibroker with the same 70min and 1030 min you would probably end with the wrong ema plots as the maximum limit of the EMA parameter is limited upto 300 only.


 
The possible logic behind the 70min and 1030 min plot in yahoo finance chart is “Yahoo Charts computes the 70min and 1030 min EMA for the 1 minute candles. and plots the same in 5 min charts. i.e the actual EMA to be plotted in amibroker for 5 min charts is 70/5=14 EMA and 1030/5=206 EMA which plots the charts exactly as in Yahoo Finance charts.

I had plotted the same for the 5min charts for nifty with Buy/Sell Signal. Buy/Sell Signal will be produced when ever the EMA crossover happens. Download the 70/1030 EMA Strategy AFL code

_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();

_SECTION_BEGIN(“EMA”);

Range1=Optimize(“range1”,14,1,20,1);
Range2=Optimize(“range2”,206,1,125,1);

Buy = Cross((EMA(Close,range1)),(EMA(Close,range2)));
Sell = Cross(EMA(Close,range2),(EMA(Close,range1)));
Short = Sell;
Cover = Buy;

// plot expanded average

Plot(EMA( Close,range1), “70min-ema”, colorRed );
Plot(EMA( Close,range2), “1030min-ema”, colorGreen );

// plot arrows
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );

_SECTION_END();

Strategy Used

USED Moving Average Crossovers in Amibroker : 206 EMA & 14 EMA
Charts Used : 5 min Charts

Go Long Rules
If The faster line (red ) goes above the green – > Close shorts & immediately go long.

Go Short Rules
The faster line (red ) goes below the green – > Close longs & immediately go short.

No other Indicators Needed… Works Well Especially in Volatile Times

Stop Loss
An initial acceptable range for the stop depending on your comfort level can be put. As the Nifty moves in your direction , immediately put the the stop at the purchase price + brokerage as soon as possible.

To Get these charts live for nifty with Zero minute delay visit nsetracker

Rajandran R Founder of Marketcalls and Co-Founder Algomojo. Full-Time Derivative Trader. Expert in Designing Trading Systems (Amibroker, Ninjatrader, Metatrader, Python, Pinescript). Trading the markets since 2006. Mentoring Traders on Trading System Designing, Market Profile, Orderflow and Trade Automation.

What is QuantZilla?

Quantzilla is 75+ hours of code mentoring program designed for noncoders who want to learn the coding program right from designing indicators, scanners, trading...
Rajandran R
58 sec read

Things to Consider While Building a Bracket Order Execution…

Building a Bracket Order Strategy is the most demanded request we got from most of the algomojo traders. This article explains the list of...
Rajandran R
12 min read

PlaceOrder – Multi Broker Exectuion Code Snippets for Amibroker

This tutorial explains how to build a button trading right from scratch and with a click of a button how you can send orders...
Rajandran R
7 min read

14 Replies to “70/1030 EMA AFL code for Amibroker”

  1. Its a nice indicator … thanks 4 that …
    Can u plz give us the afl code for Stochastic used in yahoo charts…

  2. Sir,

    i have been following MACD of yahoo 5 days. I m trading zero line cross over with very good results. but unable to write the AFL code for the same. pl help

    Rgds

    PK

  3. Hello Sir

    Thanks a lot for the wonderful ALF, sir, one request, can you provide any site or any link where i can download the eod data for dow jones?

    I want to download eod data for dow jones but cant find any where?

    Sir one more thing, can you create a 3min by 15 min afl for amibroker, as per this 315 i have tested with yahoo charts, gives good signals but dont know how to write afls, can you share please

    wanted to use it to scan share for delivery based.

    Thanks

    Akki

    Keep Rocking

  4. i am new to amibroker using a trial version(5.30). is it possible to use this afl codes for trial(expired 30 days) version.pls reply

  5. sir,

    For AMI broker users your site is an excellent resource.
    I am a regular follower of your site.

    Iam using Amibroker 5.20,and iam downloading EOD using Getbhavcopy.
    I have NSE Data from 2003 onwards. My problem is when ever i format my system/ after sytem crash, i reload Amibroker and restore NSE data but the Splits, bonus etc are to be mannually adjusted for each scrip every time Symbol->Split->OK. is there any way by which ican run the split, bonus on all scrips automatically.Also iam manuually doing the mereger like colgate-> colpal etc.and is there any way to take the backup of the upto date adjusted NSE data, so that the same can be rstored later which saves lot of time.

    pls tell me how to get the Face valu and Bookvalue of the scrip in Amibroker. if iam running Market quick review i could not get the Fv and BV against the scrip.

  6. DEAR SIR,

    as u hav shown that on 70-1030 min nifty positional call can b taken and u hv also mentioned tht use it on 5 min charts than u convert 14-206 min setting will it work same . nifty positonal call can be taken on 14-206 ema or on 5 min chart 70-1030 ma has to b ploted for positional call
    looking for ur response

    regards

  7. it is working good, but …………

    i think 20ema/200sma it is also good for intraday,
    i dont know how to creat afl, any one do that

    best regards
    chinmay

  8. hello… i want some settings for stochastic slow in 15mins TF for amibroker…

    there parameters fast %k, Slow%k and Slow %d… fast %k is the standard formula and slow k% is sma of fast %k, slow %d is sma of the slow %k… the settings i kept is 8period fast k%, 3period slow%k and 4 period slow%d…

    i want to know is m i right with these periods… if not what should i ideally be…? thanks

  9. Hi

    Above EMAs of 1 minute chart are plotted on 5 minute charts, is it possible to place 15 minute moving averages on 5 minute chart..

    Thanks

  10. Hi,
    Thanks for the wonderful strategy! I wanted to check what was this indicator was pointing to on Jan 14 (before Rajan’s surprise Rate cut!)? Was it long or short? Is there any way to check this back data? Thanks in advance for the answer!

Leave a Reply to Markethypothesis Cancel reply

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