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!

 

Reply via email to