Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
GetAtmStrategyStopTargetOrderStatus()
Collapse
X
-
-
The HelpGuide shows that the name for the order should be in all caps. Have you tried that in its place?
"STOP1"
http://www.ninjatrader.com/support/h...rgetorders.htm
Also, you can check the order name in the Orders Tab of the Control Center for more clarity on its name
Comment
-
Calonious,
Yes, I have tried using STOP1 as well and it still reported an error message. Thank you for the suggestion though.
Comment
-
Ok I tested the script to see what you are getting.
I am assuming it is this message -
If that is the case I would expect that bolded error message in this case. The Stop and Profit targets haven't been created yet since the Entry Order is in a pending submit state. You can see after the second END TRADE line that the Stop info is brought up correctly in its pending submit state.Code:---------------------BEGIN TRADE INFO---------------------- LONG POSITION -+- The entry order average fill price is: 0 The entry order filled amount is: 0 The entry order order state is: PendingSubmit The RSI value when the trade entered was: 20.4841419642105 Order ID is: a27c0a5b9b0f43c9bb38a4e9484315cc atmStrategyId is: bff81e952c8d49219bd2491998d8b545 ---------------------END TRADE Entry INFO---------------------- [B]**NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist[/B] The entry order average fill price is: 1245.25 The entry order filled amount is: 1 The entry order order state is: Filled The RSI value when the trade entered was: 21.8789957867447 Order ID is: a27c0a5b9b0f43c9bb38a4e9484315cc atmStrategyId is: bff81e952c8d49219bd2491998d8b545 ---------------------END TRADE Entry INFO---------------------- Average fill price is 0 Filled amount is 0 Current state is PendingSubmit
If this isn't it, can you clarify more on what exactly it is you are seeing?
Comment
-
Hi Calonious - thank you for looking at the code I provided.
It looks like the code is working successfully for you, which creates a bigger question for me - why isn't it working on my machine? The reason I say this is that my code always provides the GetAtmStrategyStopTargetStatus() method error, I never have a chance to see the stop loss information that is supposed to print to the Output window. But you are able to successfully view it..., is there a cache I need to delete or other tip I don't know about?
Here is my output for several trades generated by the strategy:
This output with the same method error continues for every trade thereafter. Any help is greatly appreciated.**NT** Submitting order with strategy 'ForNTReview/d49fbabb11d5487d884d6150560397b4'
---------------------BEGIN TRADE INFO----------------------
LONG POSITION -+-
The entry order average fill price is: 2043
The entry order filled amount is: 1
The entry order order state is: Filled
The RSI value when the trade entered was: 29.3232968012914
Order ID is: 218596373e894b46852e02402e22e10e
atmStrategyId is: 245c135e1bd0439ba053c3b7d76630ef
---------------------END TRADE Entry INFO----------------------
**NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist
Strategy id reset has taken place.
**NT** Submitting order with strategy 'ForNTReview/d49fbabb11d5487d884d6150560397b4'
---------------------BEGIN TRADE Entry INFO----------------------
SHORT POSITION - Winning Move*(((
The entry order average fill price is: 2047.25
The entry order filled amount is: 1
The entry order order state is: Filled
The RSI value when the trade entered was: 72.7160647396992
Order ID is: d7626224ffa4402fb4c232775c1569a2
atmStrategyId is: 55ff453db4964078b1ac882b7c89ff23
---------------------END TRADE Entry INFO----------------------
**NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist
Strategy id reset has taken place.
Comment
-
The only thing that I probably did different was that I had to create a new ATM strategy template. I put in large values between the Stop and Profit so they wouldn't get filled immediately.
The first thing that pops into my mind when seeing your logging is that the Stop or Profit might be getting filled out early but if they are still active and running on the either Orders Tab or in a Chart then try using another ATM Strategy like I did. Another good tip for debugging is throw in some time stamps with those prints I like to use Time[0] with that as it will give me the bar time of when that print was called.
Try those out. If your still lost then we can let support jump here and see what they dig up
Comment
-
-
NT Support Requested
Ninja Trader Jesse,
I worked through Calonious's suggestions and other ideas I had and received the following results:
- created new strategy template - error still received
- created new ATM-Strategy-Template - error still received
- added Stop strategy template name instead of using "Stop1", in this case it's "CodeTest" - error still received
- Restarted Computer - error still received
- Shutdown/Turnon Computer - error still received
**NT** GetAtmStrategyStopTargetStatus() method error: OrderName 'Stop1' does not exist
The following is a screenshot from the executions tabs, showing that Stop1 is used to capture trade exit data.
Also, here is the modified code that uses the Time[0] variable to aid when an entry/exit occurs. ForNTreview2.zip
Thank you in advance
Comment
-
Hello AlienKnowledge,
Thank you for your response.
I receive the same messages as you when I test the NinjaScript strategy. This occurs as the strategy is not properly reversing it's positions, I would recommend reviewing the strategy at the following link to properly reverse your ATM Strategies: http://www.ninjatrader.com/support/f...d=5&linkid=615
I added in the code for GetAtmStrategyStopTargetOrderStatus() and it works correctly in the SampleAtmStrategyReversal strategy.
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
85 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
47 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
29 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
67 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment