Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Avoid orders with different entry prices between the strategy and the real one

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

    Avoid orders with different entry prices between the strategy and the real one

    Hello!

    In my strategy I do market orders using EnterLong(), EnterShort()... where the entry price is supposed to be Close[0],
    but in reality, and I understand why (latency, queue etc) the real effective price of entry can be quite different.

    Is there a way to configure that if the difference is X, then don't execute the order?

    I work with few ticks of profit so this this is a problem for me, if only I can avoid those orders with very different prices, it would help me.​

    thanks,
    Pablo.

    #2
    Hello Pablo,

    Thanks for your post.

    Calling EnterLong()/EnterShort() will submit a market order to the close price and latency, queue, slippage, etc could occur. There are no documented methods or properties to stop that market order from being submitted once it has been called in the script.

    To prevent the stop/target orders from being submitted to the wrong side of the market when the entry order is placed, you could consider using GetCurrentBid() and GetCurrentAsk() to offset orders so that they are more likely to land on the correct side of the market.

    See these help guide pages for more information.

    GetCurrentBid(): https://ninjatrader.com/support/help...currentbid.htm
    GetCurrentAsk(): https://ninjatrader.com/support/help...currentask.htm
    <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
      Thanks Brandon!

      So, for the gap between my entry price of my script (my Close[0]) and the real price that the entry order is executed in the market, nothing can be done. Ok.

      And regarding the stop and profit orders, thanks for the info! sure it will help me too.

      thanks again.
      Pablo.​

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X