Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Duplicate entry orders on the same bar at the same time.

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

    Duplicate entry orders on the same bar at the same time.

    My Strategy keeps placing 2 orders simultaneously for longs and shorts. The issue is it'll do 2 orders going long then sell both but only place one order going short. It trades double the amount I what it to trade. Sometimes it places just 1 order, sometimes it places 2 orders.

    I use OnBarClose calculation

    How can I fix this?

    What code can be added to the Ninjascript editor to make sure it only places one order at a time?

    How to know I placed it in the correct area for the strategy to read it?

    Do you need to see my Ninjascripteditor code would that help?

    Or

    Could I add it through strategy builder?
    Last edited by lostuser; 09-06-2022, 12:07 PM.

    #2
    Hello lostuser,

    Thanks for your post.

    How are the entry/exit methods being called in your strategy?

    Are you calling your Exit method and Entry method in the same condition set?

    Are you able to reproduce the behavior using the Playback connection?

    Please share a copy of your strategy so that I may look into this further.

    To export a NinjaScript strategy, go to Control Center > Tools > Export > NinjaScript AddOn.

    I look forward to further assisting.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hello lostuser,

      Thanks for your note.

      I do not see anything specifically wrong in the code that you shared.

      To clarify, if you go to Control Center > Tools > Export > NinjaScript AddOn, add the strategy to the Export window along with any dependencies and click the Export button, you cannot export the strategy successfully. Is that correct?



      Is this a strategy that you created?

      If so, did you create the strategy using the Strategy Builder or the NinjaScript Editor?

      Strategies that are created using the Strategy Builder could be modified using the Strategy Builder if you did not unlock the code by clicking the 'Unlock code' button.

      Strategies created in the NinjaScript Editor window cannot be modified using the Strategy Builder. You would need to use the NinjaScript Editor window to modify the strategy.


      Or, was this strategy created by a third-party developer?

      If the strategy is from a third-party developer and came as a compiled assembly (DLL), the code would be locked and you would not be able to modify it.

      If this strategy was created by a third-party developer, you would need to reach out to the developer directly so that they could test and debug their strategy or provide instruction on how to properly use it.


      Let me know if I may further assist.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      62 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X