--- In [email protected], "sesamys" <[EMAIL PROTECTED]> wrote:
I hope I got everything right.
You might want to check you criteria (discrepancy between up and down
Key definitions), but code is fairly straight forward.
Key revs in darker colour.
Correct logic as you see fit.
All the best...
CJ
************
// Logic.
UpRev = L < Ref(L,-1) AND (C > Ref(C, -1) OR C > Ref(H, -1));
DownRev = H > Ref(H, -1) AND (C < Ref(C, -1) OR C < Ref(L, -1));
UpKeyRev = C < Ref(L, -1) AND Ref(C, 1) > C AND Ref(C, 1) > Ref(C, -1);
DownKeyRev = C > Ref(C, -1) AND Ref(C, 1) < C AND Ref(C, 1) < Ref(C, -1);
// Plotting.
PlotShapes(UpRev * shapeSmallUpTriangle, colorPaleGreen, 0, H, 20);
PlotShapes(DownRev * shapeSmallDownTriangle, colorOrange, 0, L, 20);
PlotShapes(UpKeyRev * shapeSmallUpTriangle, colorGreen, 0, H, 20);
PlotShapes(DownKeyRev * shapeSmallDownTriangle, colorRed, 0, L, 20);
>
> Gentelmen,
> I need your help to transform this idea into AFL code.
> Thanks in anticipation.
> The idea is to plot an arrow above (or under) the bar indicating a
> reversal day as per the belowmentioned:
> 1- Upside Reversal:
> If Day n low < Day n-1 low.
> AND Day n close > Day n-1 close or Day n-1 high.
> 2- Downside Reversal:
> If Day n high > Day n-1 high.
> AND Day n close < Day n-1 close or Day n-1 low.
> 3- Upside key reversal day.
> IF Day n close < Day n-1 low.
> AND Day n+1 close > Day n close and day n-1 close.
> 4- Downside key reversal day.
> IF Day n close > Day n-1 close.
> AND Day n+1 close < Day n close and day n-1 close.
> Your help is highly appreciated.
> Best regards.
>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/