Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error: Stop price is greater than or equal to close price

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

    Error: Stop price is greater than or equal to close price

    Greetings!
    I have been back testing a strategy that scales in two contracts at a time and places a stop at the Low of the signal bar (current bar) when entering a long position and a stop at the High of the signal bar when entering a short position.


    I received this error in the trace output during back testing and also live testing:

    "8/25/2014 1:10:52 PM Entered internal PlaceOrder() method at 8/25/2014 1:10:52 PM: BarsInProgress=0 Action=Sell OrderType=Stop Quantity=0 LimitPrice=0 StopPrice=1158.0 SignalName='' FromEntrySignal=''
    **NT** A Sell stop order placed at '8/25/2014 1:10:52 PM' has been ignored since the stop price is greater than or equal to close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy."


    What I think is happening:
    If a short signaling bar signals to set a stop at it's high, 1158.0, but the next bar opens equal to or above that high of 1158.0. Say 1158.0 or 1158.1, the short is effectively trying to enter itself higher than the stop.

    Attached is a screenshot of the problem bar(s) during backtest. A gold dot represents the stop for short positions entered. The magenta bars represent a Short should be entered on the next bar.


    Q:
    How can I capture this error and enter some logic to fix the strategy. I need to somehow capture the order and if it is going to error out, cancel the stop and any associated short entry signal if there is one.

    I have only one bar series for the strategy and CalculateOnBarClose is set to true.

    Thanks in advance for any help you can offer!
    Attached Files
    Last edited by whiterhino; 09-25-2014, 12:15 AM.

    #2
    whiterhino, thanks for the post - correct this is a back-testing capture only to highlight basically that you would in real-time see a rejected order on those invalid stops.

    An idea how to validate the stop prices was shared in this thread where the same topic was discussed - http://www.ninjatrader.com/support/f...ad.php?t=62496

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X