PureBytes Links
Trading Reference Links
|
Hello Tomasz and All,
sorry if I propose the same question again, but I'd
need to know if it's possible to convert from Metastock language to AFL any
formula containing PREV function. Tomasz showed many times, in past, how work
AMA and AMA2 but, if I'm not wrong, this case seems different, because
in "Countback line" Metastock formula, PREV doesn't refer to any averages but to
hard values. Is it possible to translate the following formula to
AFL?
LowDays := Input("Enter # days to cover last LOW for CBL calc'n:", 3, 55,
13); If(LOW > LLV(LOW, LowDays), {then ...} PREV, {previous CBLlo,
else...} If(Ref(H,-2) > Ref(H,-1) AND Ref(H,-2) > H AND Ref(H,-1) > H,
{then ...} Ref(H,-2), {2nd day back high,else...} If((Ref(H,-3)> Ref(H,-2)
AND Ref(H,-3) > Ref(H,-1) AND Ref(H,-3) > H) AND (Ref(H,-2)> H OR
Ref(H,-1) > H), {then ... } Ref(H,-3), {3rd day back high,else...}
If((Ref(H,-4)> Ref(H,-3) AND Ref(H,-4) > Ref(H,-2) AND Ref(H,-4) >
Ref(H,-1) AND Ref(H,-4) > H) AND (Ref(H,-3)> H OR Ref(H,-2) > H OR
Ref(H,-1) > H), {then... } Ref(H,-4), {4th day back high,else...}
If((Ref(H,-5)> Ref(H,-4) AND Ref(H,-5) > Ref(H,-3) AND Ref(H,-5) >
Ref(H,-2) AND Ref(H,-5) > Ref(H,-1) AND Ref(H,-5) > H) AND (Ref(H,-4)>
H OR Ref(H,-3) > H OR Ref(H,-2) > H OR Ref(H,-1) > H), {then ...}
Ref(H,-5), {5th day back high,else...} PREV )))))
Any suggestion will be wellcome.
Best regards,
Franco
|