Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

iOrder stoploss

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

    iOrder stoploss

    Hey guys,

    I modified the NT-Sample "OnOrderUpdate" with one profittarget to two profittargets. http://www.ninjatrader.com/support/f...ead.php?t=7499
    The code works in backtest on a 5Min timeframe exactly as it should.
    However, in rare cases the stop loss is not set properly.

    Here an example from MCD:
    As you can see on the marked output.jpeg, a long position is entered 03.03.2014 at 19:35:00.
    However, for some reasons the respective stoporder is placed months later on 05.08.2014 (!) at 21:10.
    When setting "Exit on close = true" will sell this position (without stop) at the end of the day and seems to work properly.
    However, I don't want to experience being invested without stoploss in reality. This problem also arose with some other stocks. However, I wanted to highlight this issue with the MCD example.

    I would be very thankful if you could help me with this issue.

    Best regards
    PaBa
    Attached Files

    #2
    Hello PaBa,

    Thank you for your post.

    It appears the entry did not fill until 05.08.2014, is this reflected in the Executions tab?

    Comment


      #3
      Patrick you are awesome! Your comment was the key to the solution!

      I modified the sample and also used LimitOrders. However, I forgot to implement the CanceOrder() in case the order is not filled... Consequently, the order wasn't filled until 05.08.2014

      Problem solved!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      60 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      148 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      98 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X