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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      81 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X