Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

IB and NT placing multiple entries at the same bar

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

    IB and NT placing multiple entries at the same bar

    I am having a problem with a strategy in IB and NT in placing multiple entry orders at the same bar. It says Error=OrderRejected Native error='OCA Group (401)' but I have check the OCO of the 3 entry long orders it's different and I even included the time of the bar and a string which indicates if it's a first, second, third entry. If I submits only 1 long entry, it will be filled but the stop 1 and target 1, stop 2 and target 2, stop 3 and target 3 will be rejected even do each bracket have different OCO.

    #2
    Hello luxurious_04, and thank your for your question.

    I would like to ask if you can add this trace code to your OnOrderUpdate method :

    Code:
    [FONT=Courier New]protected override void OnOrderUpdate(IOrder order)
    {
        Log("For order " + order + ", the oco id is " + order.oco, LogLevel.Information);
        // ... your code here
    }[/FONT]
    I would then like to ask if you could send us your log and trace files, and if possible a stripped down code sample from your strategy, so that we can look into what occurred.You can do this by going to the Control Center-> Help-> Mail to Platform Support.
    Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.
    Please reference the following ticket number in the body of the email:1543336
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      I will include that in the code of the strategy.
      Last edited by luxurious_04; 07-14-2016, 09:45 AM.

      Comment


        #4
        Hello,

        Thank you for the reply.

        Unfortunately I was unable to see the Prints requested previously in this log to know what the OCO id's are being set as.

        I did note that the error being listed is :

        Error=OrderRejected Native error='OCA Group (401)'

        A native error is an error reported from the broker, in this case it seems error number 401 is a possibility for what is happening.

        I reviewed the API error listing here: http://interactivebrokers.github.io/...html#gsc.tab=0

        Error 401 lists as a Length restriction.error, unfortunately that is all of the information I can locate on this error number if this is indeed the correct error I am looking at on the site. At this point if you have not yet contacted IB, I would suggest to do so to question the error listed specifically and why the order was rejected. They may be able to provide further information on the OCO ids used and why the order was rejected.

        In the case this is the actual error causing the reject, if this is associated with some sort of length it could be possible the OCO id being used is too long or too short, but without knowing what OCO was used it is hard to say if this is related or not.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          If it`s too long then I will reduce it. I think NT has more than 30 characters too in OCO. I count it and it`s more than 30 characters.

          Comment


            #6
            Hello,

            Thank you for the reply.

            Without further details from the broker on why the orders were specifically rejected or without further information on what the error means this is only a guess that the length may be a factor. Based on the message seen, this may be a possibility.

            Again I would suggest to contact the broker to first see if they can provide further details on the specific rejection.

            Please let me know if I may be of additional assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cre8able, Today, 03:20 PM
            1 response
            9 views
            0 likes
            Last Post cre8able  
            Started by fiddich, Today, 05:25 PM
            0 responses
            3 views
            0 likes
            Last Post fiddich
            by fiddich
             
            Started by gemify, 11-11-2022, 11:52 AM
            6 responses
            804 views
            2 likes
            Last Post ultls
            by ultls
             
            Started by ScottWalsh, Today, 04:52 PM
            0 responses
            4 views
            0 likes
            Last Post ScottWalsh  
            Started by ScottWalsh, Today, 04:29 PM
            0 responses
            9 views
            0 likes
            Last Post ScottWalsh  
            Working...
            X