# Moving Average and Percentage Band AFL code

From Sudhin Bhathija,
Hi Rajandran, I want an afl which plots the following.

Say you have a 200sma, now the afl must also plot a line which is +25% and -25% of the sma, user must be able to modify this percentage or sma, could you write one thanks, I am yet to decide the sma and % hence the flexibility is needed.
Thanks,
Sudhin

The Following AFL code user has the provision for varying the Moving Average, Perentage and the type of Moving Average( SMA, EMA, DEMA, WMA, TEMA) and the color of the moving average. to change the properties right click on the chart and select properties

Properties of Moving Average and Perentage Band AFL code

Changing the properties of Moving Average and Percentage Band

Switching Between Moving Average

Sudhin Bhathija is requesting this simple AFL code since long time back. Anyways got it done today 🙂

## Mini Certification Course on Algorithmic Trading

Welcome to the Mini Certification on Algorithmic Trading using Amibroker and OpenAlgo! This comprehensive 4-part series is designed to equip you with the knowledge...

## Pivot Reversal Strategy – Tradingview Pinescript to Amibroker AFL…

Pivot Reversal Strategy is a popular in-built strategy in Tradingview Platform. Here I had attempted to convert the pinescript v5 to Amibroker AFL Code....

## 10 Replies to “Moving Average and Percentage Band AFL code”

1. sudhin says:

Thanks Rajendra, one more if you can I want one afl for [yesterday high – today low] OR [TODAY HIGH – YESTERDAY LOW], I have one for todayhigh – todaylow. See if you can put it up if time is an issue no problem, thanks once again, I appreciate your effort, may God bless you.

3. sudhin says:

Assume u have the following data
day HI LO
DAY1 100 90
DAY2 105 83
Now i want day1 hi-day2 low =100-83=17 or [ABSOLUTE IF VALUE IS NEGATIVE ]
or
day1low – day2high = 90-105= -15(MINUS 15) OR ABSOLUTE IF NEGATIVE.
C if u can write the alf for either or I could manage with the above afl.
Thanks

4. Amirishali says:

Hats Off Rajandran !!!
You may call it Simple AFL but its worth a LOT.Actually I was also looking for such a nice formula to use it for DAY trading for small gains.Thanks a LOT to you as well as Sudhin for putting up this request to a GENIUS like you.

Amirishali

5. vijay says:

Hi Rajendan
I visited your site many times pe chance but neve took it seriously. Only today I could undersatand your good site.Thanks a lot. I want to say a few request words (i) To develop AFL like shown at this site http://www.forexpros.com/commodities/gold-technical four all time fames by increasing more indicators. You can see such combination of all indiacators in the trial software of vogaz which can be downloaded from vogaz site. (ii) To stat serial tutorial how to handle amibroker specially how to input the AFL and how to attach a sheet or remove a sheet.
If you could provide it will be great sevice to novice people like me.
Thanks again
Vijay Kumar Haryana

6. devendra says:

good mg Rajandran sir sir i have instal rtdf stock live data but its give message asoftware is expire give me totriol of instalation

7. chandan says:

dear sir,

8. reena says:

Hi Rajandran, I want an afl which plots the following.
we have a 8ema(green),AND 20 ema(red) now watch it cross overs ,
1. when green goes up by crossing red we want buy signal
2. when green goes down by crossing red we want sell signal if possible just make its afl

sincerly
reena

9. Toan says:

Thanks a lot

10. anoop tamiya says:

hello frinds i am new in amibroker but i have programing background in c#.net can any one say me the way to create autotrading system in amibroker to send nest and now without subscribing api