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
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.
15 Replies to “Simple Triple Moving Average Crossover – Amibroker AFL Code”
Thanks very much.
please confirm these indicators can be carried over for the next day also ?
Can you please suggest a correct S/L for this strategy, thanks!
You cant fix a stoploss and trade this strategy. And you cant do system trading with this.
Y cannot we do system trading ?
Dear Rajandran, is there a AFL for the below mentioned strategy
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)
RSI INCREASING OR ABOVE 50
SELL:CROSS EMA5 & EMA20 (downward) OR CROSS %K & %D (downward) OR %K<%D
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
you need to understand Amibroker AFL functions to know better. To code your own strategies you need to be familiar with AFL code.
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,,:)
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!
HOW THIS AFL TO NON REPEAT SIGNAL.?
AND HOW TO HIDE SHOW EMA ON SCREEN?
Hi, Is there an ex4 MT4 Indicator for this?
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.
SIR, i need EMA 20 50 100 crossover BUY AND SELL SYSTEM ALERT. plz help
can u suggest to enter into a profession of Real time data feed supply
I am looking for data feed software
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