Hello,

I need to calculate future value for SAR, Ref(SAR,1) works good until last
bar, and the last bar is most important for me because I want to use it in
the system which relies on tomorrow's open price. In short, I would like to
imlement this formula in AmiBroker:

SAR next day = SAR today + AccelerationFactor( highest high reached
yesterday - SAR today)  // got this formula
here<http://wiki.answers.com/Q/What_is_the_Parabolic_SAR_formula>

This is what I have so far:

// SAR today
AF = 0.02;
tSAR = SAR(AF,0.2);

// This is number of bars after last "swap" of trend
barSAR = Min(BarsSince(Cross(tSAR,H)),BarsSince(Cross(L,tSAR)))+1;

// And finally here is my attempt to calculate next day SAR,
// but results are not always the same as AmiBroker SAR ;(
// I guess I have to skip acceleration in some cases, but
// don't know how to implement this in AB...
*nSAR = tSAR + AF * barSAR * (LLV(L,barSAR) - tSAR);*

Could you help me with this ?

Best regards,
Tomek

Reply via email to