Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot Set Stop Loss on Market Replay

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

    Cannot Set Stop Loss on Market Replay

    Hello,

    I'm having sever problems running strategies on market replay.

    Sometimes it execute orders, sometimes not. Sometimes I can set stop loss, sometimes not. Sometimes i can add an ask data series, sometimes not.
    Sometimes restarting the computer/NT or changing the script name helps, sometimes not.

    I attached a simple script which opens a long position and set a stop loss. it works well online but not on MR. On MR it opens a position but doesn't set SL.
    The data is downloaded from MBTrading. Personally I don't think it's a code problem but something with the settings or corrupted data/account or something like that....

    Please, please, please help me with this one. I'm new with NT development, struggling to understand it and those kind of things make it even harder.

    Thanks
    Attached Files

    #2
    Hello,
    You are submitting the order in historical bars and thus the stop orders are behaving erratically as they are being evaluated as historical orders.

    If you append the below code then can you get the correct orders.

    Code:
    protected override void OnBarUpdate()
    {
    	if (Historical) return;
          //rest of the codes
    }



    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      THanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sjsj2732, Yesterday, 04:31 AM
      0 responses
      36 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      287 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      287 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      133 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      95 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X