Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Gain error [11]

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

    Gain error [11]

    I had an auto strategy running on USDJPY on Friday evening, connected to Gain, and in a short trade. At 5:04pm EST the strategy submitted a Buy to Cover order as my profit target had been reached and the order was rejected with the error message "Unable to submit order ... Gain error [11] Trading suspended". The strategy terminated, no order was placed, and I had to wait until the markets re-opened to get out of the trade.
    Can you please tell me what this means and how I can avoid it in future?
    Thanks.

    #2
    annettes, it sounds like you ran into trading being shutdown for the day at 5 PM EST on a Friday for FX spot products, in this case you would need to use ExitOnClose in the strategy you're running and have the session times in chart to reflect this ending time to be able to exit before the close then.

    Comment


      #3
      Thanks Bertrand. That may be the case, but I have had the same thing happen at 5pm on a Monday evening (Mon 12/7/10), when trying to enter a long trade on AUD/USD. Here is the log entry:
      12/07/2010 17:00 Order Unable to submit order '4c83d0cdee23483f80ad1928da8fead0' : GAIN Error [11] "Trading Suspended" Affected Order: Buy 1 Market

      Is there a shutdown period every day, or only at the end of the week?
      I don't want to exit on close, and I have that flag set to false in all my strategies. Surely I should be able to enter a trade at 5pm during the week?
      Thanks.
      Last edited by annettes; 08-10-2010, 11:54 PM. Reason: Added information

      Comment


        #4
        annettes, you would need to ask your broker Gain if there's for example a short maintenance break perhaps at this time, normally there's such a short 'rollover' break in FX spot trading each day.

        Comment


          #5
          I have been in touch with Gain and yes, there is a period lasting for 2-5 mins each day at 5pm ET where the trades are rolled over and trading is suspended.

          So, is there some way of intercepting the error returned from Gain and preventing the strategy from terminating itself, so that it can attempt to submit the trade again.
          Thanks.

          Comment


            #6
            You would need to add a time filter to your strategy, so it would not attempt to submit an order causing a rejection / strategy termination during this maintenance timeframe.



            You could also disable the strategy's realtime error handling thus being able to handle the order rejection yourself in the code (so submit for example 5 minutes later), however this would be reserved for advanced programmers only as it can have serious effects -

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            85 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            48 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            29 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            32 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            67 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X