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 argusthome, Yesterday, 10:06 AM
      0 responses
      20 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      18 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      14 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      9 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      40 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X