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.

Simple Triple Moving Average Crossover – Amibroker AFL Code

58 sec read

Here is the very simple and classical example to build a triple EMA (Exponential Moving Average Crossover system). System is quite popular if anyone (trader/investor) is a newbie to classical technical analysis. In this AFL the triple moving average buy, sell signals are coded and comes with Scanning and Exploration functionality.

It is a simple trend following system where the system shows buy signal if 3 EMA > 13 EMA > 34 EMA and shows a sell signal if 3 EMA < 13 EMA < 34 EMA. It works good in a trending market. When a stock/index is not trending (when it’s going sideways) the moving averages will intermingle and repeatedly crisscross each other especially during the consolidation phase. A Trader can take advantage during this phase and can use this indicator to trade the next move.

 
However like any other trend following system this system too has its own disadvantages. Catches signals very late, sometimes at the peak. And it could withstand the noise in a sideways market to some extend avoiding multiple whipsaws compared to a double moving average crossover system.

Nifty Futures Hourly Charts with Triple EMA Crossover
Triple Moving Average Crossover

https://gist.github.com/1daa3297a1ebeeeab37a

How to Setup the Amibroker AFL

1)Download Triple Moving Average Crossover – Amibroker AFL Code.
2)Unzip Triple Moving Average Crossover.afl to local folder
3)Copy Triple Moving Average Crossover.afl file to \\Program Files\\Amibroker\\Formula\\Averages\\
5)Open Amibroker and Open a Blank Chart
6)Goto Charts->Averages and apply/drag-and-drop the Triple Moving Average Crossover code over blank chart.
7)Bingo you are done. Now you will be able to see the triple moving average crossover with buy and sell indicators.

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

15 Replies to “Simple Triple Moving Average Crossover – Amibroker AFL Code”

  1. Thanks very much.

    please confirm these indicators can be carried over for the next day also ?

  2. Dear Rajandran, is there a AFL for the below mentioned strategy

    INDICATOR:

    EMA 5,20,50 Period
    VMA 5 Period
    MACD Short Period 12,Long Period 26,EMA Period 9
    RSI 10 Period
    SSTO K Period 14,D Period 3

    BUY:CROSS EMA5 & EMA20 (upward)
    EMA20>EMA50
    RSI INCREASING OR ABOVE 50
    SSTO %K>%D

    SELL:CROSS EMA5 & EMA20 (downward) OR CROSS %K & %D (downward) OR %K<%D

    kanakaraja

  3. how did u get your parameter periods in 3 Ema’s like 3, 2, 300, 1, 10 ?…do you have any parameter periods that i can use for EMA8. >SMA 20..>SMA 50..>SMA 100….so i can make also a buy signal when this 4 moving average aligned and below the price?…thanks very much sir

      1. i already have the code for it …what is lacking is the parameters..for ema8, sma20,sma 50,sma 100…can u please provide it for me..or post an afl about it…thanks boss,,:)

  4. Hi Mr Rajandran. I am from Singapore. Do you have codes on Atlas Line for MT4. I tried searching the web but to no avail. Thank you very much and have a nice day ! Cheers!

  5. Hi Sir,

    If i add a line in this code that i will buy a script if it crosses 3 EMA > 13 EMA > 34 EMA. Suppose i get a list of scripts with buy signal and buy price and target price and stoploss and i want to backtest all those scripts which are given by this afl. Is there any way of backtesting these scripts automatically through any afl which would give me the profit/loss in each script for past 1 year or 2 year.

  6. can u suggest to enter into a profession of Real time data feed supply

    I am looking for data feed software

  7. sir i want 250 ema 180ema 120ema 50ema converging at one point (candle)
    if ema is above the candle then sell and if ema is below the candle buy
    i want alert output also for this
    hope you can help me

Leave a Reply to ashish Cancel reply

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