Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT7 SampleOnOrderUpdate

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

    #16
    Bertrand,

    Please find attached the original "SampleOnOrderUpdate" from the NinjaScript Educational Resources | Reference Samples | "Strategy: Using OnOrderUpdate() and OnExecution() methods to submit protective orders" post (05-08-2008). Also attached is the "SampleOnOrderUpdateLessTokens", this is simply the "SampleOnOrderUpdate" with the eight references to Tokens removed.

    Regards
    Shannon
    Attached Files

    Comment


      #17
      Looks good to me Shannon - in realtime trading you would need to add a check to submit only at valid stop order prices determined by the current bid / ask prices...this is likely why you saw the invalid sell Stop order placed issue, this had nothing to do with the structural changes you were doing.

      Comment


        #18
        Bertrand,

        Thanks for reviewing the strategy.

        Unfortunately, the invalid sell stop order issue occurred well out of realtime trading. The error occurred well into history.

        Please re-run the "SampleOnOrderUpdateLessTokens" on the ES 06-10. The sell stop order placed at '7/05/2010 6:15:00 AM" was ignored. This is near two months away from current realtime. While this futures contract is now expired, this issue was still present while the contact was active.

        Any further ideas would be most welcome.

        As always, thanks and regards
        Shannon

        Comment


          #19
          Shannon, I ran your strategy and got the same error (but at a different time). The exact text of the error is as follows: "A Sell stop order placed at '5/6/2010 2:15:00 PM' has been ignored since the stop price is greater than or equal to close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy."

          As long as you've followed Bertrand's suggestion about placing orders with regards to the current ask and bid price, you will be fine.

          The error occured because of the way the backtester works-basically, it places orders the bar after the condition for the order happens. In this case, the stop price was greater than the price, which does not make sense and would likely be rejected by your broker anyways. The error has nothing to do with the changes you've made to migrate this strategy to NT7.
          AustinNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          601 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          347 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          559 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          558 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X