PureBytes Links
Trading Reference Links
|
Hi friends
I have the following metastock formula to be converted into AFL.
To my understanding, there are 3 issues to be converted, out of which I know solution for 2 of them.
1) assignment operator ":= " is to be changed as "="
2) "If" is to be changed as "IIF".
The third one is 'PREV' in metastock. I have read the previous posts in this forum reg 'PREV', but frankly I could not be understand it as a non-programmer.
Shall be thankful for your help in converting this metastock formula into AFL.
Quote
Stop1:=If( PREV < L,
If(( H - 4.5*ATR(21) ) >= PREV,
( H - 4.5*ATR(21) ),
PREV),
( H - 4.5*ATR(21) ));
Stop2:=If( PREV < L,
If(( C - 3.5*ATR(21) ) >= PREV,
( C - 3.5*ATR(21) ),
PREV),
( C - 3.5*ATR(21) ));
StopLong:=If(Stop1>Stop2,Stop1,Stop2);
Stop1:=If( PREV > H,
If(( L + 4*ATR(21) ) <= PREV,
( L + 4*ATR(21) ),
PREV),
( L + 4*ATR(21) ));
Stop2:=If( PREV > H,
If(( C + 3.5*ATR(21) ) <= PREV,
( C + 3.5*ATR(21) ),
PREV),
( C + 3.5*ATR(21) ));
StopShort:=If(Stop1<Stop2,Stop1,Stop2);
If( ((Year()<=2008) OR (Year()=2009 AND Month()<=04 AND DayOfMonth()<=31)),
If((BarsSince(L<Ref(StopLong,-1))>BarsSince(H>Ref(StopShort,-1)) ),StopLong,StopShort),C);
Unquote
With best regards
UMR Perumal
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|