Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy error messages

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

    Strategy error messages

    I am running a strategy that keeps generating an error that shuts down the strategy.
    Error: “Strategy ‘PluseMACD/282924001’ submitted an order that generated the following error ‘Unable to change order’. Strategy has sent cannel requests, attempted to close the position, and terminated itself.”
    Error: “SimPulseMACD, Stop price can’t be changed above the market affected Order: Sell 1 StopMarket @ 16866.”
    Can anyone tell me how to correct this error? Thank you.
    Joseph Walker

    Attached Files

    #2
    Hello jnorton47,

    The reason for the error is that the order was moved to an invalid price that was above market so it was rejected.

    The error notes that this was a stop market order. Are you using the SetStopLoss/SetTrailStop method or submitting a stopmarket order at a custom price using logic?



    Comment


      #3
      Hi Jesse,

      Thank you for your reply. I am using the SetStopLoss/SetTrailStop method.
      Do you know how to stop this error?

      Joseph

      Comment


        #4
        Hello jnorton47,

        With the SetTrailStop that can happen because the trailing stop is updated based on the bar close events. If you are using a very close to market price or offset its possible to see that when the bar closes the calculated price lands on the opposite side of the market price. The easiest solution is usually to increase the offset so its not trailing as close to the active market price.

        If you are using the set methods from within OnBarUpdate and calculating a custom price in that situation you would need to try to confirm that the price is valid before calling the method. That still will relate to the bar close events so if you use a larger bars type like 30 minutes as an example it would still be possible to calculate an invalid price depending on what you are basing the price on.

        To get a better idea of what specifically is happening you will need to find out which specific order was rejected and then review the offset/price being used for that specific order. If it is not clear why that is happening with that order we would need to know what specific code you used for the target and also the bars type being used and Calculate setting. We would also need to know where that is called in your logic, for example in OnStateChange or OnBarUpdate.



        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