System design bug? - Aussie Stock Forums

Results 1 to 2 of 2
  1. #1

    Join Date
    Jan 2010
    Adelaide, Australia

    Default System design bug?

    Hi all,

    I am in the midst of developing my first system and seemed to be having some great results (unrealistically so??) until I changed a setting in the ApplyStop function I am using.

    The line of code changes my CAR from being highly positive (46% up to 214%) to be very small or negative (6% down to -68% ). These results are based on the ASX for the 2009 calendar year. I have run each setting approximately 10 times using position score to provide a crude monte carlo test. The troublesome line is below -

    Winning line:
    ApplyStop( stopTypeTrailing, stopModePoint,TrailAmount, 2, True )

    Losing line:
    ApplyStop( stopTypeTrailing, stopModePoint,TrailAmount, 1, True )

    My understanding of the difference is that the 'winning' line will sell the following day if my stop is hit (at open), while the 'losing' line will sell on the day and at the stop price.

    My system is a simple trend system with 3 key criteria - highest high after x days, liquidity test and a momentum check. There hasn't been a lot of optimisation.

    Can anyone see any obvious flaw that I am missing? I have started comparing trade for trade between the two, but nothing stands out.

    Reference info regarding the ApplyStop function -
    ExitAtStop = 0 - means check stops using only trade price and exit at regular trade price
    (if you are trading on close it means that only close price will be checked for exits and exit will be done at close price)
    ExitAtStop = 1 - check High-Low prices and exit intraday on price equal to stop level on the same bar when stop was triggered
    ExitAtStop = 2 - check High-Low prices but exit NEXT BAR on regular trade price.

  2. #2

    Join Date
    Jan 2010
    Adelaide, Australia

    Default Re: System design bug?

    I have solved the issue - by having ExitAtStop = 1 (i.e. exit on the same day at your trailing stop price), it allowed buy orders that were triggered from the previous day to be entered when the trailing stop was hit.

    So effectively i would get a buy and sell order for the same stock and both would occur.

    Having the setting set to 2, prevented the buy order from being filled as the sell order occurred on the following day. I am thinking there must be a setting that would prevent this from happening in the first place?


Similar Threads

  1. BUG - Buderim Group
    By Odduna in forum Stocks 0-H
    Replies: 1
    Last Post: 11th-November-2015, 08:01 AM
  2. Mechanical System Design Project - Join hands?
    By skl99 in forum Trading Strategies/Systems
    Replies: 45
    Last Post: 23rd-February-2010, 09:07 PM
  3. Trade System Design - Reducing Drawdown
    By chesl73 in forum Trading Strategies/Systems
    Replies: 4
    Last Post: 13th-November-2009, 10:26 PM
  4. Help me design a backtesting system
    By Sunder in forum Trading Strategies/Systems
    Replies: 14
    Last Post: 19th-June-2009, 06:40 PM
  5. CommSec website bug
    By kamil in forum Brokers
    Replies: 7
    Last Post: 26th-July-2007, 11:43 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Aussie Stock Forums