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

[amibroker] Re: Newbie help with backtest



PureBytes Links

Trading Reference Links


Ed,

Thank you for the additional information.  I will have to study what 
you've said...not sure I understand it yet.  Still have a lot to 
learn about AFL.

I appreciate the help,

TS

--- In amibroker@xxxxxxxxxxxxxxx, "ed nl" <ed2000nl@xxxx> wrote:
> I forgot to have a look at your question about the open.  I solved 
this using loops but it can be done using applystop also. What you 
want the code to simulate is that if your limit is not reached the 
money is still reserved that day in the market. So you don't want to 
add this constraint in the Buy definition because then it will use 
the money to buy something else instead
> 
> So you add this constraint in the nBar stop. For instance you Buy 
if the price goes below yesterdays close and you may short if the 
price goes above yesterdays close. Meaning if the low is greater than 
yesterdays close the Long position will not be entered (same story 
with short)
> 
> nnb = IIf( (Buy == 1 AND L > Ref(C,-1)) OR (Short == 1 AND H < Ref
(C,-1)),0,nb);
> 
> ApplyStop(stopTypeNBar,stopModeBars,nnb,ExitAtStop = 1,Volatile = 
False, ReentryDelay = 1 );
> 
> So now the backtest exits the same day if the entryLimit is not 
reached. Effectively this money is not used for 1 bar,
> 
> 
> rgds, Ed
> 
>   ----- Original Message ----- 
>   From: techsmart 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Monday, November 29, 2004 4:39 PM
>   Subject: [amibroker] Newbie help with backtest
> 
> 
> 
> 
>   Hope you won't mind a newbie question or two...or three...
> 
>   I'm not new to system development, but I am new to Amibroker and 
am 
>   trying to convert systems from another software platform.
> 
>   I'm sure AB can do what I want, but I haven't been able to figure 
it 
>   out.
> 
>   My system looks for EOD setups each night.  This usually results 
in a 
>   few to several dozen watch list symbols.  The next day the system 
>   enters on a limit price if hit.  Then the system exits on a 
profit 
>   target or a timed stop.
> 
>   So, how do I...
> 
>   1) exit on a profit target based on the entry price, eg: the exit 
>   would be on the close on a day when the HIGH was greater than the 
>   ENTRYPRICE*1.05.  So, I need to reference the entry price.
> 
>   2) If the target exit conditions are not fulfilled, then the 
trade is 
>   exited on the close of the 4th day after entry.  I think this can 
be 
>   done using the stops in the AB backtest settings.
> 
>   3) For the entry, I think I can use the ref command to see if the 
>   setup occurred yesterday and then see if the low was lower than 
the 
>   limit target price.  Then enter on the lowest of the open or 
>   yesterday's close*limit price.
> 
>   Thanks for any help.  Once I get a backtest or two going, I 
should be 
>   able to figure this stuff out.
> 
>   TS
> 
> 
> 
> 
> 
> 
> 
> 
>   Check AmiBroker web page at:
>   http://www.amibroker.com/
> 
>   Check group FAQ at: 
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> 
>         Yahoo! Groups Sponsor 
>               ADVERTISEMENT
>              
>        
>        
> 
> 
> --------------------------------------------------------------------
----------
>   Yahoo! Groups Links
> 
>     a.. To visit your group on the web, go to:
>     http://groups.yahoo.com/group/amibroker/
>       
>     b.. To unsubscribe from this group, send an email to:
>     amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       
>     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.





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