AFL is easier. Use the Formula Editor icon to check your code. The guide has many excellent exmaples. Try this thinking:
Price = ((H+L)/2); alpha1 = (0.25); alpha2 = (0.35); Lead = (0); NetLead= (0), EMA= (0); - EMA is a defined term - don't use it - use EMA1 or something Plot(EMA1, "EMA1", colorRed, styleLine, Null, Null, 10 ); --- In [email protected], "goldandwood" <[EMAIL PROTECTED]> wrote: > > Hello everyone! Below is the tradestation code of Leading indicator > from John Ehlers. I've tried translating it into AFL code several > times but failed as my programming knowledge is very limited! I post > it here so let someone who is good at AFL to do the job and make it > shares with all....thank you very much!! > > > Inputs :Price((H+L)/2), > alpha1(0.25), > alpha2(0.35); > Vars : Lead(0), > NetLead(0), > EMA(0); > Lead = 2*Price + (alpha1 - 2)*Price[1] + (1 - alpha1)*Lead[1]; > NetLead = alpha2*Lead + (1 - alpha2)*NetLead[1]; > EMA = 0.5*Price + 0.5*EMA[1]; > Plot1(NetLead,"Lead"); > Plot2(EMA,"EMA"); > > > And thanks again! >
