Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting Results Very Skewed to the Negative

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Backtesting Results Very Skewed to the Negative

    1) I am backtesting a strtaegy that includes an 8-tick SL...However, it appears that it is not exiting until the bar closes (when the SL has been hit or exceeded)-which results in losses much greater than the 8-tick target.

    How do I set this to exit on the SL rather than waiting for the bar to close? Changing the "CalculateonBarCLose" to 'False' in the strategy doesn't seem to change the reuslts

    Also

    2) I have built in a 8-tick profit target as well-and it doesn't execute a close if the Profit target touches this price (it seems it must go through this price)--how do I change this in the strtaegy or the settings to execute if touched. I know this can be set in real time using the ATM-but wasn't sure how to get this effect in the strategy.

    If this can't be done directly, is there a work around so that it fills an exit order as close as possible to the Profit target?

    The net effect of both of these situations is that it totally skews the results to the negative, so much so, a very good strategy looks horrible on the backtest.
    Jim-Boulder
    NinjaTrader Ecosystem Vendor - Elephant Tracks

    #2
    Hi Jim,

    1) I am not sure I follow. In backtest, we only know the OHLC of a bar. Therefore, on each bar, we check open orders and check each on to see if they are filled. A stop order or limit order are processed in the same manner in terms of when they are checked for a possible fill.

    2) Change the property on the strategy dialog when running a backtest to "Liberal" from "Default".
    RayNinjaTrader Customer Service

    Comment


      #3
      How to enforce SL and PT's

      Ray,

      Thanks for the reply. I am confused by the results I am getting in the backtesting. Here's what I want to happen:

      * All trades are entered with a fixed 8-tick stop loss and profit target. I expect no loss to be greater than 8 ticks, nom profit greater than 8 ticks. (I am less worried about 1-tick slippage)
      * What I am getting are losses higher than 8 (many times, some as high as 2 points)--which of course skews the backtesting results (to the negative).

      ------------------------Details----------------------------------------------

      Trades are entered based upon a combination of indicators, with a fixed stop loss of 8 ticks, and a fixed profit target of 8 ticks.
      For simplicity, let's assume that the trigger for entering a trade is an 2 EMA crossover. Once a bar closes, and the EMA's crossed over in that bar, I want to enter the market at the market price (long or short depending on which EMA crossed above). I assume that the entry price will be the open of the next bar (which should be very close to the close of the bar, right?). I do not want a limit order for entry because the market may move away from us and it not be filled.

      I also want a stop loss and a profit target placed (each for 8 ticks) at the same time.

      I would expect to never have a loss > 8 ticks, or a profit > 8 ticks using this scheme.

      The only additional condition in the strategy is if the EMA's cross back over in the opposite direction from the open trade, the open trade is exited. Thus we can get smaller than 8 tick losses, or less than 8 tick profits under this approach if either are less than 8 when the ema crosses.

      The problem may be how I am building the entry and exits. I used the wizard and selected Simple "Enter long" for entries and "Exit Long" in case the EMA's crossed again. Then, in the last step of the wizard, I used a stop loss and profit targets that referred to a user variable of SL and PT-which are defaulted to 8 ticks. I did not use limit orders in any of the wizard.

      Any ideas why I am getting these strange results?
      Jim-Boulder
      NinjaTrader Ecosystem Vendor - Elephant Tracks

      Comment


        #4
        Hi Jim,

        1) Sell stop orders are filled at the higher value of the following two, the low of the bar or stop price - slippage amount set. If you see something different, I would need to see a snapshot of the Order's tab in the SA pointing to the order that was filled at a price you feel is incorrect.

        2) Its possible since you may also be exiting on a cross instead of the 8 tick stop loss that the exit on cross is at market and if there is an extreme gap from on bar to the next, you will get filled at the open of the gap bar. This could account for the large loss.
        RayNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by stafe, 04-15-2024, 08:34 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by StrongLikeBull, Yesterday, 04:05 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Mestor, 03-10-2023, 01:50 AM
        14 responses
        375 views
        0 likes
        Last Post z.franck  
        Started by molecool, 10-09-2017, 10:48 AM
        5 responses
        1,621 views
        0 likes
        Last Post trader-ap  
        Started by The_Sec, Yesterday, 03:53 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X