Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to Change Order, Stop Price can't be changed

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

    Unable to Change Order, Stop Price can't be changed

    Click image for larger version

Name:	Stop Order Error.png
Views:	193
Size:	15.5 KB
ID:	1311971
    Hello,
    I keep getting this error on my trailing stop. I am using Renko bars and updating the stop to the open of the previous bar as long as I am in a position,
    but when the trend reverses and the stop is hit, it gives this error and disables to strategy. Any tips?
    It happens at the end of the uptrend on the chart below.​


    #2
    Hello DZ469,

    This message is due to changing the price order to the incorrect side of the market so it is rejected. Most commonly you will see this when using a strategy that uses OnBarClose processing. If you are updating the stop for each bar close it is possible that when the bar closes the price used for the stop will not be on the correct side of the market. That could be for multiple reasons, using the position average price for the basis of the offset can lead to the price being on the wrong side of the market or also using bar data to calculate an offset could cause that to happen as well. The only way to avoid that would be to make sure the order is only being changed to a price that is on the correct side of the market at the time of the order update. You may also need to change the frequency at which the order is trailing if you are using your own logic, for example if a strategy was running on each tick and you are updating the order on each that that would be more easily prone to getting this type of rejection.

    Comment


      #3
      Hi, yes, I was variously using Open[3] and different values of SMA[] to set the stop, but when the bar flips from green to red, it seems like it's somehow shifting the stop to a value outside the red bar instead of activating the stop and exiting the position.

      Comment


        #4
        Hello DZ469,

        That would be up to your logic to control in that situation. If you are using a price for the target which becomes on the opposite side of the market before making an amendment it will be rejected. You would have to add logic to check that the price you are using is on the correct side of the market before submitting a change.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        54 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        131 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        73 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
        49 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X