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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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 -

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            4 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Started by alifarahani, Today, 09:40 AM
            6 responses
            40 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            18 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X