Thank you for posting the AFL It does not come through as a cohesive afl though. Is it possible for you for copy and paste it in the text? It looks as if Yahoo did something to your original afl when you put it as an attachment
Thank you Mark From: [email protected] [mailto:[email protected]] On Behalf Of Edward Pottasch Sent: Tuesday, April 06, 2010 6:30 AM To: [email protected] Subject: Re: [amibroker] Bernstein's CTOD as daytrading system- help with afl code [1 Attachment] [Attachment(s) from Edward Pottasch included below] hi, you are on the right track but there are multiple ways to solve such a problem in Amibroker. I have some standard codes for these type of problems. The problem seems simple but with all the exit contraints I find it easiest to use an exit loop. I add my code but again there are other ways to solve it that might look easier. I tested this setup on futures but it does not seem to be profitable. regards, Ed chart how it looks like From: mateusz.krysiak <mailto:[email protected]> Sent: Sunday, April 04, 2010 1:20 PM To: [email protected] Subject: [amibroker] Bernstein's CTOD as daytrading system- help with afl code hello I' am a amibroker beginner. I 've spend a lot of time looking through the internet , but I didn't find nothing similar to this. So i gave up and decided to ask for help. Of the point: I want to create a afl code which would reflect CTOD intraday system ( Critical time of day)- p. 186[http://www.scribd.com/doc/7408934/the-compleat-day-trader-vol-i] . The assumtions of system : - buy if 5 minute bar close above max from 2 hours after session start ( 5 minute close) - short if 5 minute bar close below max from 2 hours after session start (5 minute close) - buy works as both cover and opens new postiion - short works as sell and opens new postions Two different ways in two different systems closing positions 1) Close postion = time 16.06. ( few minutes before session close) or if RSI (15) cross "20" (sell) and "80" (cover) 2) Close if 5min bar close below/ above max/min from last one Hour. I have only something like this : // ForceCloseTradesAfter = 160600; Buy=Cross(C,Ref(HHV(C,24),-1)); // It should be better to replace HHV by Bar since or Value when ? Sell=Cross(Ref(LLV(C,24),-1),C) OR (TimeNum() > ForceCloseTradesAfter); // greetings Mateusz
<<image001.png>>
