Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop order ignored in strategy backtest

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

    stop order ignored in strategy backtest

    I have a strategy which uses unmanaged orders. The backtest could throw out an error like:
    Strategy 'xxxxxxxx/-1': A Sell stop order placed at '7/29/2008 11:40:00 AM' has been ignored since the stop price is less than or equal to the close price of the current bar.

    I understand that sell stop price should be less or equal to last price. However, in a very volatile market, it is hard to set the stop price right since the price moves very fast. And it seems to be a behavior change from Ninjatrader 7.

    The same startegy works in Ninjatrader 7. Because I have implemented the OnOrderUpdate interface. If the stop order could not fill(rejected), I will catch the event and then submit a market order. The code is like:
    protected override void OnOrderUpdate(Order order, double limitPrice, double stopPrice, int quantity, int filled, double averageFillPrice, OrderState orderState, DateTime time, ErrorCode error, string comment)
    {

    // Rejection handling
    if (order.OrderState == OrderState.Rejected)
    { /// change to market order and submit it
    }
    }

    Can we have the same logic in Ninjatrader 8 so that we can catch the event and turn to market order?

    Thanks,

    #2
    Hello rcfcu2000,

    Thanks for your post.

    The strategy analyzer is not rejecting the order but is advising that it is ignoring the order.

    To debug you can enable TraceOrders http://ninjatrader.com/support/helpG...raceorders.htm and use various print statements to print the orders price levels and bid/ask and see what code needs adjusting.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Paul, thanks for the reply.

      That is exactly my question. Ninjatrader 7 behaves differently in this case and nt7 behavior is expected.

      Why does strategy analyzer "ignore" the order? Is there an event for "ignored" orders? the strategy code will need to be invoked if the order is not filled. I would expect the strategy analyzer reject and trigger an event in the strategy code.

      Comment


        #4
        Hello,

        Thanks for your post.

        The behavior should be the same between NT7 and NT8. If you could provide a small testable sample strategy it would assist us in tracking down the cause. If you would prefer not to post publicly, feel free to send into PlatFormSupport[at]NinjaTrader[dot]com. with a link to this thread and atten:Paul
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        1 response
        16 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        11 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        6 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        244 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        387 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X