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