Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simulated Stop Loss Market Orders for Automated Trading

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

    Simulated Stop Loss Market Orders for Automated Trading

    hi,

    For exchanges and brokers that do not support stop loss orders as market orders.
    I understand that Ninja Simulates stop loss market orders as stop limit orders.

    But the limit offset is too small, i believe it is defaulted to 20 ticks.
    When my stops losses are triggered, i want to make sure i get out.

    How do i set a bigger offset ?

    I am trying to do this either via ninja script or via .Net interface and i am testing HSI futures traded on HKFE with PATSystems.

    thanks

    #2
    aljafp, correct for the ATM generated StopLimit exit orders the offset is 20 ticks per default - for NinjaScript / AT interface you should be able to send a custom offset you wish...or are you calling ATM's for your exits from those, too?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      aljafp, correct for the ATM generated StopLimit exit orders the offset is 20 ticks per default - for NinjaScript / AT interface you should be able to send a custom offset you wish...or are you calling ATM's for your exits from those, too?
      Say I use PLACE command via .NET interface to place a ATM strategy for entry.
      I am depending on the default stop loss order of the ATM template.

      How do i set the offset for stop limit exit orders in this case ?

      I hope you understand this is important as 20 ticks offset for a contract like Hang Seng Futures is NOTHING, but i want to guarantee that i will get out when i want too.

      thanks
      Last edited by aljafp; 02-03-2010, 07:20 PM.

      Comment


        #4
        Unfortunately you would then use the standard offset of the ATM's - can't you use stop market orders on the HSI instead?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Unfortunately you would then use the standard offset of the ATM's - can't you use stop market orders on the HSI instead?
          I definitely would like to use stop market orders if it is possible with Ninja.

          So maybe you can let me know how this is possible with Ninja ?

          I am using C# with .NET trading HSI Futures on HKFE with PATsystems.

          But when i send in Orders to enter a position using ATM strategy templates, Ninja automatically sends the Stop loss orders as a Stop limit with a 20 ticks offset.
          How do i change this ?... I want the stop loss to be market orders.


          thanks
          Last edited by aljafp; 02-04-2010, 05:15 PM.

          Comment


            #6
            aljafp,

            Please provide the code snippet you are using to submit your order that results in the 20 tick offset.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              aljafp,

              Please provide the code snippet you are using to submit your order that results in the 20 tick offset.
              //This is the C# client

              Client client = new Client();
              String accountName = "SIM101";
              String HSIContract = "HSI 02-10";
              client.Command("PLACE", accountName, HSIContract, "BUY", 5, "MARKET", 0, 0, "DAY", "", client.NewOrderId(), "HSI_Long", "HSI_Long1");

              Attached is a screenshot of the ATM template.
              Attached Files

              Comment


                #8
                Originally posted by aljafp View Post
                //This is the C# client

                Client client = new Client();
                String accountName = "SIM101";
                String HSIContract = "HSI 02-10";
                client.Command("PLACE", accountName, HSIContract, "BUY", 5, "MARKET", 0, 0, "DAY", "", client.NewOrderId(), "HSI_Long", "HSI_Long1");

                Attached is a screenshot of the ATM template.
                I just want to add that even if i do something like straightforward like
                client.Command("PLACE", accountName, HSIContract , "BUY", 2, "STOP", 0, 23000, "DAY", "", client.NewOrderId(), "", "");

                Instead of a stop market order, ninjatrader sends it as a stop limit order with 20 ticks offset too.

                I have tested this both in NinjaTrader 6.5 and 7, both exihibit the same characteristics.

                Comment


                  #9
                  aljafp, thanks for sharing your findings, could you please contact us via the Help > Mail to Support feature and reference this thread, this way we have access to your trace and logs and can review - please check with your broker which ordertypes they directly support on the HKFE, as we do not support the PATS synthetic order types.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_Bertrand View Post
                    aljafp, thanks for sharing your findings, could you please contact us via the Help > Mail to Support feature and reference this thread, this way we have access to your trace and logs and can review - please check with your broker which ordertypes they directly support on the HKFE, as we do not support the PATS synthetic order types.
                    I will test Ninja with PATsystems soon.

                    But for now, i am doing some preliminary testing using IB first.
                    But i am hitting a road block with this situation.

                    You can try out my examples with IB.
                    You will get the same result.

                    Stops ( entries and exits ) are send by Ninja as a stop limit with 20 ticks offset. This makes ninja unusable for a market like HSI and HHI.HK.
                    In a fast market, 20 ticks could be the bid/ask spread !

                    I think the solution for markets/brokers where ninja has to use stop limits to simulate stops, to allow users to set the offset.
                    This could be set per ATM strategy template or at Instrument level.
                    Whatever the case, it should not be hard coded as 20 ticks.

                    Actually i have another concern.
                    For exchanges/brokers that do not support market orders natively, when triggered ninja would send in a limit order right ?
                    Does this 20tick restriction apply to market orders too ?
                    It should right since stops are "converted" to market orders when triggered.
                    IF so, then this makes market orders unusable for HSI/HHI.HK too.

                    All in all i am very surprise at my findings.
                    Makes me wonder if anyone is actually using Ninja to send stop/market orders for HSI/HHI.HK
                    Last edited by aljafp; 02-05-2010, 06:07 PM.

                    Comment


                      #11
                      Originally posted by aljafp View Post
                      I will test Ninja with PATsystems soon.

                      But for now, i am doing some preliminary testing using IB first.
                      But i am hitting a road block with this situation.

                      You can try out my examples with IB.
                      You will get the same result.

                      Stops ( entries and exits ) are send by Ninja as a stop limit with 20 ticks offset. This makes ninja unusable for a market like HSI and HHI.HK.
                      In a fast market, 20 ticks could be the bid/ask spread !

                      I think the solution for markets/brokers where ninja has to use stop limits to simulate stops, to allow users to set the offset.
                      This could be set per ATM strategy template or at Instrument level.
                      Whatever the case, it should not be hard coded as 20 ticks.

                      Actually i have another concern.
                      For exchanges/brokers that do not support market orders natively, when triggered ninja would send in a limit order right ?
                      Does this 20tick restriction apply to market orders too ?
                      It should right since stops are "converted" to market orders when triggered.
                      IF so, then this makes market orders unusable for HSI/HHI.HK too.

                      All in all i am very surprise at my findings.
                      Makes me wonder if anyone is actually using Ninja to send stop/market orders for HSI/HHI.HK
                      hey guys, any feedbacks on this issue ?

                      thanks

                      Comment


                        #12
                        Hello aljafp,

                        Unfortunately this is as expected as per stop limit orders submitted as stop losses; they will use an offset of 20 ticks, which unfortunately cannot be changed.

                        The offset applies to stop limit orders submitted as stop loss.
                        JasonNinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Jason View Post
                          Hello aljafp,

                          Unfortunately this is as expected as per stop limit orders submitted as stop losses; they will use an offset of 20 ticks, which unfortunately cannot be changed.

                          The offset applies to stop limit orders submitted as stop loss.
                          Please read through my posts carefully.
                          As i indicated, even stop entry orders are affected.

                          Again, as i indicated, i would like Ninja to send stops if possible.
                          But for some reason even with brokers like IB, ninja is sending stop losses as stop limits. Stop entries as stop limits too.

                          Please look through my posts carefully.

                          Comment


                            #14
                            Just tested via the DLL ATI interface which uses the function calls - for entry orders I can designate the stop / limit used, just as manual placing StopLimit orders in NT.

                            When calling ATM's for exit management of coure the default 20 tick offset is applied as previously noted.

                            Any chance you could send me your exact call used?
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_Bertrand View Post
                              Just tested via the DLL ATI interface which uses the function calls - for entry orders I can designate the stop / limit used, just as manual placing StopLimit orders in NT.

                              When calling ATM's for exit management of coure the default 20 tick offset is applied as previously noted.

                              Any chance you could send me your exact call used?
                              I've already posted the code in post #7 of this thread.
                              I do not know what else you want of me.

                              At the end of the day, I would like to know
                              1.
                              Why is it a command like this
                              client.Command("PLACE", "SIM101", "HSI 02-10" , "BUY", 2, "STOP", 0, 23000, "DAY", "", client.NewOrderId(), "", "");
                              Send a stop limit to Ninja when it should be a stop ?

                              2. For HSI traded on HKFE,
                              How do i set a stop market order as exit order, via DLL/ATI interface.
                              Currently if you try my code sample given in post #7 in this thread, it doesn't send exit order as stop market order.

                              3. Any plans to support Patsystems synthetic stops (SyOMS) ?
                              OpenQuant tells me that their product can support.

                              thanks
                              Last edited by aljafp; 02-11-2010, 05:44 PM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Johnny Santiago, 10-11-2019, 09:21 AM
                              95 responses
                              6,193 views
                              0 likes
                              Last Post xiinteractive  
                              Started by xiinteractive, 04-09-2024, 08:08 AM
                              2 responses
                              11 views
                              0 likes
                              Last Post xiinteractive  
                              Started by Irukandji, Today, 09:34 AM
                              1 response
                              3 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by RubenCazorla, Today, 09:07 AM
                              1 response
                              5 views
                              0 likes
                              Last Post RubenCazorla  
                              Started by TraderBCL, Today, 04:38 AM
                              3 responses
                              25 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X