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

[amibroker] Re: Backtest Behavior Question/Problem



PureBytes Links

Trading Reference Links

Hi Terry,

Tomasz cleared it up for me, but I would still say that the 50% stop 
should have been executed if this were a real trading day.  The 
reason is that my stock didn't gap up, it opened at $15 or $16.  That 
means that the stock had to work its way up from that price to the 
high, which means that along the way the price must have crossed my 
stop at $21.48.  Unless you assume there was an intra-day gap, which 
I've never seen before on that kind of scale.

So basically, it's just the way Amibroker handles it, and there's no 
way around it.  It's not TOO big a deal, and while it would 
definitely be nice to more accurately simulate my trading, I guess 
I'll have to live with it.

--- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> wrote:
> It depends now on whether you have bars between the 50% point and 
the
> 100% exit. If you're trading daily and it changed during the day 
there
> is no bar for it to exit on other than the close (depending on your
> settings). According to your data it does appear that your stop was 
only
> exceeded on this day and the exit then is correct.
> 
> Short entry at $14.32
> 50% Stop loss would be $21.48
> Stop exceeded sometime during the day as evidenced by the High
> Exit at the High of $28.76 which is > 2 times the entry = 100% loss.
> Without intraday bars it has no way of knowing when the price went 
above
> your 50% level until the day is done.
> |Open = $20.50
> |Close = $28.19
> |Low = $20.28
> |High = $28.76
> 
> I agree the ruin stop on a single stock shouldn't stop the trading. 
This
> assumes you have set your PositionSize to something less than 100%
> (-100) so each stock, when trading multiple stocks, doesn't use all 
your
> money.
> --
> Terry
> 
> 
> | -----Original Message-----
> | From: amibroker@xxxxxxxxxxxxxxx 
> | [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of tycanadian2003
> | Sent: Sunday, June 26, 2005 02:39
> | To: amibroker@xxxxxxxxxxxxxxx
> | Subject: [amibroker] Re: Backtest Behavior Question/Problem
> | 
> | 
> | Hi,
> | 
> | It didn't gap up close to 100% or even 50%, so there's no reason 
why 
> | the loss should be 100% instead of the correct 50%.  Basically, 
the 
> | stock opened at a reasonable price and then shot up and closed at 
a 
> | high price.  This day, the day where the stock shot up over 100%, 
> | was the first possible exit point (vi stop loss).  No other exit 
> | signals were generated before it, and in other similar situations 
> | (but without a 100% single-day change), the backtester behaves 
> | properly.  It is only because of this 100% "ruin stop" thing that 
it 
> | seems to be misbehaving.  Also, this 100% rule seems silly since 
> | this trade is a short and if someone has 20 positions in their 
> | portfolio, this means they only lose 5% of their overall equity 
> | assuming equal money distribution.  
> | 
> | Any further ideas?  Tomasz, do you know why this might be 
happening?
> | 
> | --- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> wrote:
> | > Check to see if the stop was reached when the first possible 
exit
> | was
> | > the 100% loss.
> | > 
> | > --
> | > Terry
> | > 
> | > 
> | > | -----Original Message-----
> | > | From: amibroker@xxxxxxxxxxxxxxx
> | > | [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of tycanadian2003
> | > | Sent: Saturday, June 25, 2005 15:46
> | > | To: amibroker@xxxxxxxxxxxxxxx
> | > | Subject: [amibroker] Re: Backtest Behavior Question/Problem
> | > | 
> | > | 
> | > | Thanks for the info, Terry.  I figured it was something to do
> | with 
> | > | either a "split warning" or a "100% or greater loss".  
However,
> | that 
> | > | still doesn't explain why my 50% stop didn't kick in.  Any 
ideas
> | on 
> | > | this?
> | > | 
> | > | --- In amibroker@xxxxxxxxxxxxxxx, "Terry" <MagicTH@xxxx> 
wrote:
> | > | > Short (6). 6 is the "ruin loss" stop code. If you lost 100% 
on
> | a
> | > | single
> | > | > trade you would have a "ruin stop".
> | > | > 
> | > | > --
> | > | > Terry
> | > | > 
> | > | > 
> | > | > | -----Original Message-----
> | > | > | From: amibroker@xxxxxxxxxxxxxxx 
> | > | > | [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of
> | tycanadian2003
> | > | > | Sent: Friday, June 24, 2005 05:58
> | > | > | To: amibroker@xxxxxxxxxxxxxxx
> | > | > | Subject: [amibroker] Backtest Behavior Question/Problem
> | > | > | 
> | > | > | 
> | > | > | 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
> | > | > | 
> | > | > | 
> | > | > | 
> | > | > |  
> | > | > | 
> | > | > |
> | > | 
> | > | 
> | > | 
> | > | 
> | > | 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
> | > | 
> | > | 
> | > | 
> | > |  
> | > | 
> | > |
> | 
> | 
> | 
> | 
> | 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
> | 
> | 
> | 
> |  
> | 
> |




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/