Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Invalid Buy/Sell stop during a strategy

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

    Invalid Buy/Sell stop during a strategy

    Hi. I've not yet learnt using OnOrderUpdate / OnExecution so I'm simply using EnterLong / Exit long etc with onPriceChange.

    My strategy works fine. Once my Limit order fills, I submit an ExitLongStopMarket and ExitLongLimit. However, there are instances where the market moves super fast and the Exit Orders pull up an error. "Cannot Submit Stop Order below current price " etc.....

    And this leaves my position open without an exits. What's the best way to deal with this? to close the position if no exit orders are present?

    I could have a loop that checks if price has strayed outside my Profit and Stop levels and submit another ExitLong with the same signal name? or is there a better way?

    #2
    Hello several,

    Thank you for your post.

    You can change your RealtimeErrorHandling to IgnoreRejects or IgnoreAlErrors, then you could code your own error rejection handling in OnOrderUpdate (for example, if the stop is rejected attempt to resubmit it).

    The Help Guide page below has some sample code demonstrating.



    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    111 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    59 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    38 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    41 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    78 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X