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