AIQ Trading Bands to AFL
Can anyone please transform this AIQ code from S&C Mag to AFL, if u
can, so it can be cut & pasted.
Thanks in advance
g
----------------------------------------------------------
Here is the AIQ TradingExpert Pro code from Stocks & Commodities
Magazine for plotting both kinds of bands.
Aiq Eds code for Average True Range and Standard Deviation Bands
Define AvgPd 20.
!StDev Bands
StdDev is Sqrt(Variance([close],AvgPd)).
Stdh is ExpAvg([close],AvgPd) + 2 * StdDev.
Stdl is ExpAvg([close],AvgPd) - 2 * StdDev.
TrueRange is
max([high]-[low],max([high]-val([close],1),val([close],1)-[low])).
AvgTrueRange is SimpleAvg(TrueRange,AvgPd).
!ATR Bands
Stdha is ExpAvg([close],AvgPd) + 2 * AvgTrueRange.
Stdla is ExpAvg([close],AvgPd) - 2 * AvgTrueRange.
----------------------------------------------------------