Hi Ed, When I inserted the code in the AA, I get the error as follows:
Ln64, Col: 10: Error 29, Variable 'break' used without having been intialised. I use AB 4.8 any way out ? thx. On Tue, Apr 6, 2010 at 3:59 PM, Edward Pottasch <[email protected]>wrote: > > > [Attachment(s)<https://mail.google.com/mail/?ui=2&view=js&name=js&ver=nW3OxUDq0kU.en.&am=!8Ag9prYTo5-QtdzVFfQwW2ivk2pCHPO6tKyji7Eo0NnT4kNx&fri#127d2abf5358abe3_TopText>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 <[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 > > > -- -
<<kri.png>>
