Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem changing Stop orders

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

    Problem changing Stop orders

    I am using a strategy that uses two Stops and two Targets. I am having trouble adjusting the Stop values. If I change only one of the Stops, it works fine. If I try to change both Stops, one immediately after the other, then one of the Stops, and its corresponding Target are cancelled. I have tried changing the order that the Stops are changed, but that has no effect.

    When I look at the log, it recognizes both of the change commands, but then proceeds to cancell one of the Stops and its Target.

    Any suggestions on what I am doing wrong would be appreciated.



    #2
    imported post

    Hi,

    Sorry for the delay.

    Make sure that you set the Single Click Order Modification to True.

    You can do this by right clicking in the DOM--> Properties--> Single Click Order Modification--> True. Then click Apply and OK.

    Then modify your 1st Stop with your left mouse button and your 2nd stop with the middle mouse button. Click on the new Stop price and the Stop will be modified.

    Vince
    Vince B.NinjaTrader Customer Service

    Comment


      #3
      imported post

      Hi Vince. Thanks for the response. It's my fault that I was not clearer on my problem. I am making these changes automatically within Esignal using the Ninja functions, not on the DOM. Does this make a difference in your thought process?

      Thanks in advance.


      Comment


        #4
        imported post

        Hello,

        I am answering on behalf of Vince.

        If you want to change an order that was automatically submitted by an internal NinjaTrader strategy, use the intCommand function and pass in the strategyId and order name (STOP1 or TARGET1 etc) via the orderId parameter. A return value of 0 indicates success and -1 indicates an error. Success indicates success in submitting the command NOT that the order has in fact been changed. Ensure that you are passing in the correct strategyID for the 2nd stop order and that you are using the ntChange command and not ntCancel. Please reply.

        Comment


          #5
          imported post

          Again, thanks for your reply and support. It seems I am doing what you are saying, but not obtaining the results I think I should get. In summary:

          Two Stops and two Targets = Stop1 and Stop2, with Target1 and Target2.

          In abbreviated nomenclature:

          NTChange(.....Stop1...) followed by

          NTChange(.....Stop2...) results in Stop2 and Target2 being cancelled. Also if you reverse the order of Stop1 and Stop2, the results are the same, with one of the pairs being cancelled.

          If I only send a change for one of the pairs, i.e.:

          NTChange(.....Stop2...) then the price for Stop2 is adjusted as requested, and the Stop1 remains the same. I can reverse it and change Stop1 only, and the result is the same. A unique strategyID is being used, or this won't work.

          It seems as if NT cannot handle two Change orders one line after the other. Could this possibly be the issue?

          Thanks in advance.




          Comment


            #6
            imported post

            It should not be an issue. That being said, let's find out. Can you try and change commands on a different bar. For example, Bar1-->Change1, Bar2-->Change2. Do you get the results you expect?


            RayNinjaTrader Customer Service

            Comment


              #7
              imported post

              I have tried your suggestions in two different ways. For instance, I changed Stop1 on one bar, then delayed the change of Stop2 for 50 ticks. This resulted in Stop1 change OK, then Stop2/Target2 are cancelled. Then I tried changing Stop1 on one bar, then delayed the change of Stop2 until the following bar. The result was the same, Stop2/Target2 were cancelled.

              I also tried the same methodology with Stop2 first, which resulted in the Stop1/Target1 pair being cancelled.

              Any thoughts?

              Comment


                #8
                imported post

                Can you create a test file for me to reproduce on my side including the strategy parameters. I will need to re-create it here.

                Ray
                RayNinjaTrader Customer Service

                Comment


                  #9
                  imported post

                  Ray, any luck with the file I sent?

                  Comment


                    #10
                    imported post

                    I replied sometime ago asking you to generate a simple strategy without all the extra code. A basic test case that I can use. Never received a response from you.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      imported post

                      Ray, sorry I did not receive your request for simpler code. I have created a simpler file for you from Bleemus' "ninjatest" file. It is about as simple as it can get and still have the functionality that I have described. I am sending it to your support mailbox since this forum does not allow efs extensions.

                      Comment


                        #12
                        imported post

                        Just uploaded a new version 5.2.1000.4 that resolve this issue. Available from our website.

                        Ray
                        RayNinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by elirion, Today, 01:36 AM
                        0 responses
                        3 views
                        0 likes
                        Last Post elirion
                        by elirion
                         
                        Started by gentlebenthebear, Today, 01:30 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post gentlebenthebear  
                        Started by samish18, Yesterday, 08:31 AM
                        2 responses
                        9 views
                        0 likes
                        Last Post elirion
                        by elirion
                         
                        Started by Mestor, 03-10-2023, 01:50 AM
                        16 responses
                        391 views
                        0 likes
                        Last Post z.franck  
                        Started by rtwave, 04-12-2024, 09:30 AM
                        4 responses
                        34 views
                        0 likes
                        Last Post rtwave
                        by rtwave
                         
                        Working...
                        X