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 NullPointStrategies, Today, 05:17 AM
      0 responses
      52 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      48 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X