Jim Dean
 Sage
       Posts: 3433
Joined: 3/13/2006
Location: L'ville, GA
User Profile |
Try this - adds if/then for warmup delay, necessary when a complex argument is used with a called function like SMA:
#Indicator
#PARAM "ShortPeriods", 5
#PARAM "LongPeriods", 34
Dim fMACDao as Single
if bar > LongPeriods then
fMACDao = SMA((H+L)/2, ShortPeriods) - SMA(H+L)/2, LongPeriods)
Plot("MACDao", fMACDao)
end if
Return fMACDao
[Edited by Jim Dean on 11/14/2012 11:01 AM]
|