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

[amibroker] Backtest Behavior Question/Problem



PureBytes Links

Trading Reference Links

Hi,

Glad to see the threads on performance were of interest to so many 
people.  Anyhow, I have a new question!

I have a play-system that I run a backtest for over the last 10 
years.  On 8/18/1999, it Shorts the stock "DITC" at a price of 
$14.32.  In my code, I have a 50% intraday max-loss stop, 
ActivateStopsImmediately = TRUE, ExitAtStop = 1.  On 8/20/1999, the 
day's data is as follows:

Open = $20.50
Close = $28.19
Low = $20.28
High = $28.76

The Backtester exits the stock at a price of $28.64 (exactly double) 
and beside the word "Short" in the "Trade" column, there is a "(6)", 
so it looks like "Short (6)".  I have checked and this stock did not 
split or anything.  With my 50% stop, it should have exited at $21.48 
on 8/20/1999.  My stop works properly on dozens of other occasions on 
many other stocks in the same backtest, but it seems that when a 
stock goes bad by over 100% in a single bar, strange things happen 
with the Backtester.

Interestingly, even if I remove my max-loss stop (and my code should, 
in theory, exit the following bar, 8/23/1999, at open), it STILL 
exits on 8/20/1999 with a "Short (6)" in the "Trade" column at $28.64 
for a loss of exactly 100%.

This also happens in other situations, but I figured I'd just pick 
this one as an example.

How can I make the Backtester behave correctly in this situation?  I 
am stumped.  Any input is welcome.  Thanks!




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/