[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Code Help



PureBytes Links

Trading Reference Links


Hello
I had attemped to code the following expression, however Iam raw to 
AFL code
but iam not able to code it properly. Can any one help me in how it 
done

VolAvg20 > 150000
Last > P Low
PI Close <P2Close
P2C)osc < P3Closc
P3Closc < P4Closc

Explanation:
VolAvg20: Average volume the stock has traded over the last 20 days.
1' Low: Previous Day's low.
PI Close: Previous day's close
P2Close: The close the day before
P3Close: The close (he day before P2
P4Close: The close the day before P3

AFL Code
// trades 

AvgPeriods=20;
MinVolume=150000;

Buy= MA(V,AvgPeriods)>MinVolume
AND C>Ref(L,-1)
AND Sum(Ref(C,-1)< Ref(C,-2)=3);

Sell = MA(V,AvgPeriods)>MinVolume
AND C<Ref(H,-1)
AND Sum(Ref(C,-1)>Ref(C,-2),3)=3;

Thanks 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> 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/