Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

setstoploss order from TS 8.1

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

    setstoploss order from TS 8.1

    Hi again,

    When implementing a strategy via TS 8.1 with a "setstoploss" order, NT puts the stop order on hold, as it should, but then keeps adding subsequent stop orders on hols as time goes by and the strategy does not require the stop to be filled.

    Then eventually, when the strategy calls forthe stop to befilled, NT will fill as many stops orders as it generated....

    Result: if the original position was short , after the stop is called, instead of being flat, we'll be long by as many stop orders as were put on hold, except for the last one, which was the only real stop that the strategy needed.

    Any ideas on how to prevent this from happening?

    Tks, Pepe

    #2
    imported post

    Pepe,

    Can you send an email from within the application to support. Go to Help--> Mail to Support. That way log files are attached and we can take a look at the messages in the log.

    Put in the subjec 'For Vince'

    Vince
    Vince B.NinjaTrader Customer Service

    Comment


      #3
      imported post

      Are you running the TS Email interfaceor making DLL calls within your strategy?

      Ray
      RayNinjaTrader Customer Service

      Comment


        #4
        imported post

        Sorry for the delay - I was out.

        I just sent Vince the log files - I am running the TS e-mail interface.

        Pepe

        Comment


          #5
          imported post

          Is your stop order generated with a new signal name each time? If yes, NT wouldcreate a new stop order since each signal name is unique.

          Ray
          RayNinjaTrader Customer Service

          Comment


            #6
            imported post

            Ray, not sure what you mean by "signal name".

            The log shows actions "buy to cover" or "sell" if short or long respectively, and order "stop" in every case of repetition, with different ID and Token...

            The TS strategyplaces a "setstoploss" after going long or short and a trailing stop after it reaches a certain profit level- trailing stop if working fine.

            Comment


              #7
              imported post

              Please do the following:

              Create a strategy where this behaviour is seen.
              Delete all files in C:\Program Files\NinjaTrader 5\trace
              Start NT
              In NT, Tools > Options > General enable "Diagnostics"
              A Diagnostics tab will appear in the Control Center. On this tab, check "Server"
              Run the strategy so this behaviour is experienced.
              Once you have experiences several stop orders generated
              Shut down
              Send me the following file


              C:\Program Files\NinjaTrader 5\trace\ninjatrader.txt

              to ray at ninjatrader.com
              RayNinjaTrader Customer Service

              Comment


                #8
                imported post

                Ok, did it and I'm waiting to get a few more repeats...

                But already it's giving me trouble -I hada long position initiated after 3 pm on GBPUSD filled at 1.9685... and it was closed at 8 pm with one of the stops "on hold" with a fill at 1.9633, a loss of 52 pips, while the market at that time was actually above 1.9700, so it should have been a profitable trade!!!

                Comment


                  #9
                  imported post

                  Ray,

                  I just sent you the file - this time I got 2 trailing stop orders at around 10 pm where there should have been only one, turning a long position into a short one insetad of going flat...and there's still a stop order on hold from after 3 pm ... :shock:

                  Comment


                    #10
                    imported post

                    Thanks for sending the file.

                    NT is working as designed. Your strategy is sending duplicate stop orders for what I suspect is only meant to bea replaced order.



                    For example, this is the an email we receive at about 10 PM which is an "Active order" which then submits this as an order.

                    TradeStation - Strategy Active Order for GBPUSD
                    Order: Sell 1 GBPUSD @ 1.9666 Stop Market
                    Account:
                    Occurred: 12/19/2006 8:00:05 PM
                    Signal: Stop Loss
                    Interval: 60 min.
                    Workspace: C:\Program Files\TradeStation 8.1 (Build 3258)\MyWork\NinjaTraderPP


                    Two minutes later we receive the following which is also an "Active order" so NT submits another stop order. I suspect you likely wanted to replace the order above with this new price.

                    TradeStation - Strategy Active Order for GBPUSD
                    Order: Sell 1 GBPUSD @ 1.9664 Stop Market
                    Account:
                    Occurred: 12/19/2006 9:59:45 PM
                    Signal: Stop Loss
                    Interval: 60 min.
                    Workspace: C:\Program Files\TradeStation 8.1 (Build 3258)\MyWork\NinjaTraderPP


                    Please check your TS strategy since that is the source of the issue.

                    Ray
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      imported post

                      tks Ray,

                      my strategy has only one lines which reads: "setstoploss (stoplossamt) ;"

                      as to how TS implements that line I have no idea, apparently it sends repeated signals as time goes by, which messes things up at the NT end.

                      so, how do we deal with this,

                      - tell TS to redesign their "setstoploss" so that it works with NT? I think not...

                      - have NT reinterpret the signals generated by said function? maybe...

                      - use some other kind of stop loss generating order/code? maybe...

                      I tried the last optionbut only got a worse performing strategy and I'm not knowledgeable enoughin EasyLanguage to find a way around it.

                      Any ideas anybody?

                      Pepe




                      Comment


                        #12
                        imported post

                        There for sure is nothing for us to do on our side. TS Emails are very clear:

                        Active Order
                        Filled Order
                        Replaced Order
                        Cancelled Order

                        The strategy is sending Active Order several times so we must follow the logic and submit as manyorders as we receive notifications for.

                        Funny thing is, no one else has this issue which is why I pointed back at your strategy. Maybe a setting somewhere in TS?

                        Ray
                        RayNinjaTrader Customer Service

                        Comment


                          #13
                          imported post

                          yeah, and maybe nobody is using the "setstoploss" ...

                          How about using the DLL instead of the emil interface - I am not familiar with it and don't know how it works - can you explain the difference?

                          tks, Pepe

                          Comment


                            #14
                            imported post

                            DLL interface requires programming, much more advanced. A little faster as well since there is no email delay.

                            SetStopLoss works, I have tested it many times.
                            RayNinjaTrader Customer Service

                            Comment


                              #15
                              imported post

                              You mean setstoploss works with TS email?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by inanazsocial, Today, 01:15 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post inanazsocial  
                              Started by trilliantrader, 04-18-2024, 08:16 AM
                              5 responses
                              22 views
                              0 likes
                              Last Post trilliantrader  
                              Started by Davidtowleii, Today, 12:15 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Davidtowleii  
                              Started by guillembm, Yesterday, 11:25 AM
                              2 responses
                              9 views
                              0 likes
                              Last Post guillembm  
                              Started by junkone, 04-21-2024, 07:17 AM
                              9 responses
                              71 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X