Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Nt + Ib + Ts

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

    Nt + Ib + Ts

    I am working with Sim NT trying to figure out if i can automate my trading strategy from TS to IB using NT Dlls

    But now i am getting this error message

    "Order Event Warning.Attribute 'Outside Regular Trading Hours's ignored based on the order type and destination. Place order is now being processed. (2109)

    When i try to place a DAX OCO stop and limit.

    I browsed over the forum and i saw many users reported this problem but that was back in 2008.

    I am using latest Ninja + Latest TWS.

    Is this issue still unsolved?


    Is there any workarround?

    Best Regards
    SM
    Attached Files
    Last edited by StockMaster; 10-12-2009, 12:31 PM.

    #2
    Hello SM,

    The error message is related to your default order settings in TWS. I believe orders outside regular hours are disbaled in TWS on your end. However, the order is processed anyway based on the order type and destination.

    In addition, please have TWS version 895 installed as per the IB connection guide at the link below.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Hi Jason

      Actually i found something interesting

      Order is only rejected if i use the NT Command function as follows

      NT Command ("Place","","BUY",1"stop",0,5900,"","123","MyOrder ID","","");
      NT Command ("Place","","BUY",1"Limit",0,5700,"","123","MyOrde rID2","","");

      If i use the NTBuyStop i do get the warning message but the order is accepted.

      I used NT Command in order to send OCO orders.

      Is it possible the OCO is creating the problem?

      Best Regards

      Comment


        #4
        For your order type, you should just use STOPLIMIT instead of two separate orders. Wouldn't that do what you want or am I missing something?
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I want to send an OCO order after a Position is taken.

          So if i am Short, after recieving fill confirm i want to send a Stop to buyand a limit to buy linked by OCO Id.

          IF i try to do so by NTCommand:


          IF fill then ...

          NTCommand ("Place","","BUY",1"stop",0,5900,"","123","MyOr der ID","","");
          NTCommand ("Place","","BUY",1"Limit",0,5700,"","123","MyOrde r ID2","","");

          both orders get canceled.

          BUT if i send the same orders but by using the NTBuyLimit and NTBuyStop (not linked by OCO) i dont get the error.

          So i wonder IF it can be something related to the OCO link that is bing rejected by IB.

          Regarding the IB default order settings in TWS, i have selected Futures and "alow orders to be triggered outside..." something something (forgot the exact saying there).

          Pic Below shows the settings
          Attached Files

          Comment


            #6
            Make sure you are filling out the proper NTCommand fields.
            It seems as if both your NTCommands are sending stop prices and not one stop and one limit. You are also missing a comma before the orderType parameter.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hello Josh, i think i may have commited a typo while typing in the code here in the forum.

              Lets do it propperly and use copy paste

              Here is the 2 command lines i used

              Success =NTCommand("place", "", "Buy", 1, "Stop", 0, 5900, "Day", "OCO123", "MyOrderIdStp", "", "");
              Success =NTCommand("place", "", "Buy", 1, "Limit", 5700, 0, "Day", "OCO123", "MyOrderIdLmt", "", "");


              I reviewed it line by line and i dont think i done anything wrong. Still the orders are being canceled. Unless i use them by NTBuyStop and NTBuyLimit commands, which again makes me think it can be related to the OCO or TimeInForce ID's.

              The log wont especify why the order is canceled except the error showed in the 1st image.
              But then again, the BUYLimit and BUYstop commands show the same warning message but orders are not canceled.

              Best regards

              Comment


                #8
                Please try submitting your orders to Sim101 instead of IB to isolate if it is IB or something with the order submission process causing the issue.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Will try first thing tomorrow morning when dax reopens

                  Thank you Josh!

                  Comment


                    #10
                    I encontered a diferent problem now, not so much related to the DLL but maybe someone here has a clue of what i may do to fix this.

                    I went deeper in the coding of my strategy:

                    Basicly what i have is the Starting position trades to get triggered at the end of the bar.

                    Although, i thought about ONLY sending the positions protective orders, Stop and Limit after getting the report back from IB about the fill, as well the fill price.

                    My problem is as i cant wait one more bar to send Stop and Limit orders i have to send them with update every tick enabled on TS.

                    The problem is this makes the code send Multiple Stop and Limit orders, basicly it sends so many that IB starts rejecting them. The code only stops sending this orders when the bar closes.

                    Does anyone of the members of the forum, or maybe the NT support knows this behaviour and or any work arround for it?

                    Best Regards

                    Comment


                      #11
                      StockMaster,

                      I guess I am not following you. Why would your TS code submit the same order so many times? Could you not limit it with some if-statements? Once submitted, stop resubmitting?
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello Josh

                        First of all, i am testing the OCO orders and after several reviews of the settings i think i got that working. I still get the Warning messaged in the Log of NT but they are submitted and not canceled.

                        Regarding the Multimple orders.

                        Yes, that seems to be the case. The way TS works, on each tick of each bar it will resubmit the orders. I think i may have to work in a way to make TS Lock inside the bar the variable so i can STOP the code to resubmitting. I was reading about a paramenter "intrabarpersist".

                        But i thought about inquiring to be sure there was no other work arround

                        Best Regards

                        Comment


                          #13
                          StockMaster,

                          The message may occur. If your orders go through, it can be ignored.

                          I think that workaround will be the best way to continue with the constant resubmissions.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            open next bar stop orders

                            If I use the NTBuyStop() command in a TS strategy can I insert
                            open next bar + .25*Avgtruerange(20) as my stop level ?

                            - (just like I do in TS/EL normally)

                            Comment


                              #15
                              evanscje,

                              Unfortunately we are not EL experts so could not comment on EL code. But in general, what you would want to do is call NTBuyStop() and in the stop price pass in whatever you want the stop price to be. When the code is reached, it will submit a buy stop order to NT. I would imagine you would need to wait till the next bar to be able to get that bar's open price in correctly, but again, since I am not a TS/EL expert you would have to try. I suggest just printing out the values of what you get when you try something like open enxt bar + .25*Avgtruerange(20) and see if that matches what you were looking for.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by GussJ, 03-04-2020, 03:11 PM
                              11 responses
                              3,227 views
                              0 likes
                              Last Post xiinteractive  
                              Started by andrewtrades, Today, 04:57 PM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post chbruno
                              by chbruno
                               
                              Started by josh18955, 03-25-2023, 11:16 AM
                              6 responses
                              440 views
                              0 likes
                              Last Post Delerium  
                              Started by FAQtrader, Today, 03:35 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post FAQtrader  
                              Working...
                              X