Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Optimization log message saying An order has been ignored since the stop price....

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

    Optimization log message saying An order has been ignored since the stop price....

    I am running Optimization on my custom strategy and I noticed the Logs window is filled with messages like the one below. I am unsure why this happening.

    Code:
    Strategy 'MyCustomStrategy/-1': An order has been ignored since the stop price ‘4522.75’ near the bar stamped ‘09/11/2023 10:12:21’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored.


    #2
    Hello wzgy0920,

    Thank you for your post.

    The message is letting you know that a stop order was ignored because the strategy submitted the order to an invalid price level. Buy stop orders must be placed above the current ask price. Sell stop orders must be placed below the current ask price.

    When the order is submitted, is the stop price parameter greater than the GetCurrentAsk() for a buy stop order? Or, is the stop price parameter less than the GetCurrentAsk() for a sell stop order?


    I recommend you add prints to the strategy to determine why the stop order is being ignored. One line above where the stop order is placed, print the GetCurrentAsk() and print the price being submitted to the order method.

    Below is a link to a forum post that demonstrates using prints to understand behavior.

    https://ninjatrader.com/support/foru...121#post791121



    Please see the help guide documentation below for more information about GetCurrentAsk().

    https://ninjatrader.com/support/help...currentask.htm



    Please also note that there is no intrabar movement with historical processing. If the strategy is using Standard Order Fill Resolution, it will create "virtual bars" based on the OHLC of the next bar to simulate how market data moved and then fill the order.

    This error could be resolved by adding intrabar granularity to your strategy or setting Order Fill Resolution to High (or both).

    Please see this forum post below which goes over the differences between Historical vs. real-time and implementing intra-bar granularity:

    https://forum.ninjatrader.com/forum/...ive#post773377


    If you have any other questions, please let me know.

    Comment


      #3
      Originally posted by NinjaTrader_Gaby View Post


      Please also note that there is no intrabar movement with historical processing. If the strategy is using Standard Order Fill Resolution, it will create "virtual bars" based on the OHLC of the next bar to simulate how market data moved and then fill the order.

      This error could be resolved by adding intrabar granularity to your strategy or setting Order Fill Resolution to High (or both).

      Please see this forum post below which goes over the differences between Historical vs. real-time and implementing intra-bar granularity:

      https://forum.ninjatrader.com/forum/...ive#post773377

      My strategy relies on Calculate= Calculate.OnPriceChange. Just to confirm, Even though Order Fill Resolution is set to Standard, will it still have simulated price change movements within the current bar???

      An unrelated question, I have another thread where I reported incorrect results based on the value of IsInstantiatedOnEachOptimizationIteration. Is there any other specifics I should know about Optimization that will help me troubleshoot that issue?

      Comment


        #4
        Order Fill Resolution set to standard will only calculate bars based on the OHLC and will not place orders within the bar (no intra bar movement).


        Since you have your strategy set to Calculate.OnPriceChange, you will need to enable tick replay and implement 1-tick intra-bar granularity in order to have intrabar movement.


        As for your IsInstantiatedOnEachOptimizationIteration question, Chelsea will follow up about that in your other thread.


        Please let me know if you have any other questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        559 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        546 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X