Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Real time error handling

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

    Real time error handling

    Is real time error handling supposed to work on playback? I ask because I was running my strategy on playback and an error came up but it didn't close the position and the it stayed open until close of session. I have real time error handling set to the default so it should close all positions upon receiving an error.

    #2
    Hello, thanks for writing in. Real Time Error handling will work in the playback connection. In order for an error to cause the strategy to trigger the real time order handling, it must throw one of the error codes:

    Code:
    ErrorCode.LoginExpired
    ErrorCode.LogOnFailed
    ErrorCode.NoError
    ErrorCode.OrderRejected
    ErrorCode.OrderRejectedByRisk
    ErrorCode.Panic
    ErrorCode.UnableToCancelOrder
    ErrorCode.UnableToChangeOrder
    ErrorCode.UnableToSubmitOrder
    ErrorCode.UserAbort
    ​
    If no actual error code is thrown, it will not run the real-time order handling setting.

    Could you provide more details on what you are seeing in the user interface when this happens? Can you share the error message?

    Comment


      #3
      These are the 2 boxes that pop up when an error occurs. It cancels my stop loss and my target but keeps me in the position. The only way to exit is to manually close all orders.

      Click image for larger version

Name:	1st pic.jpg
Views:	432
Size:	273.7 KB
ID:	1255757


      Click image for larger version

Name:	2nd pic.jpg
Views:	412
Size:	300.0 KB
ID:	1255758

      Comment


        #4
        Hi, thank you for posting this. The answer to this was answered in the past here, see post #7:

        Hello, I am detecting abnormal behaviors in a strategy, and I would like to resolve a question: if the RealTimeErrorHandling property is set to StopCancelClose and an exception occurs in the code (for example of type NullReferenceException) what should happen? I assume that pending orders (Accepted, Working) are automatically


        The position will not be closed by a run time error in your code. The strategy is placing a buy stop market order below the market, this can be fixed by ensuring that the price you are using is > GetCurrentAsk();

        Comment


          #5
          I looked at post Visitor Messages in the link you sent but does that mean it's still being implemented to where the order doesn't come back as an error if this happens? I have these orders set under the 'stops and target' section in strategy builder so I'm assuming the stop orders are market orders.

          Comment


            #6
            Hello, thanks for the follow up. This error means that you are placing stops/targets on the wrong side of the market. Your stop loss order may be getting set incorrectly. Can you post a screen shot of the Stops and Targets section?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            39 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            64 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            41 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X