View Full Version : Problem changing Stop orders
08-07-2006, 04:22 AM
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.
08-07-2006, 06:32 AM
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.
08-07-2006, 06:37 AM
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.
08-07-2006, 06:46 AM
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.
08-07-2006, 06:58 AM
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.
08-07-2006, 07:25 AM
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?
08-08-2006, 09:39 AM
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.
08-08-2006, 09:44 AM
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.
08-17-2006, 03:44 AM
Ray, any luck with the file I sent?
08-17-2006, 03:46 AM
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.
08-17-2006, 02:02 PM
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.
09-25-2006, 09:17 AM
Just uploaded a new version 5.2.1000.4 that resolve this issue. Available from our website.