I built a PracticeAtmStrategy based on SampleAtmStrategy (odd, I can't seem to export this). The strategy basically works but it leaves old non-functioning Sell Stp and Buy Stp orders hanging on the chart. I refreshed my Sim101 account and that removed them, but the random remaining orders began accumulating again with the next order that triggered. They can't be removed by clicking on the X, or hitting the Close button or Disabling the Strategy. Is there a line of code that would dispense with them? Or some other method? Thank you for any guidance.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
ATM Strategy Anomalies
Collapse
X
-
ATM Strategy Anomalies
Hello,
I built a PracticeAtmStrategy based on SampleAtmStrategy (odd, I can't seem to export this). The strategy basically works but it leaves old non-functioning Sell Stp and Buy Stp orders hanging on the chart. I refreshed my Sim101 account and that removed them, but the random remaining orders began accumulating again with the next order that triggered. They can't be removed by clicking on the X, or hitting the Close button or Disabling the Strategy. Is there a line of code that would dispense with them? Or some other method? Thank you for any guidance.Tags: None
-
Hello JohnS52,
Thank you for your post.
Can you please provide a screenshot of the Orders tab from the Control Center showing the stuck orders? It would be helpful to see the status of the stuck orders.
Also, does the SampleAtmStrategy script included in the platform work fine if you use your Atm strategy template with that script? To test that out, open SampleAtmStrategy in the NinjaScript Editor > Right click within the Editor > Save As to save it as a new script. In this new script, change the atm strategy template used in AtmStrategyCreate() to your strategy template.
I look forward to assisting further.Gaby V.NinjaTrader Customer Service
-
Hello NinjaTrader_Gaby,
Thank you for your response. I changed all the atmStrategyId fields to atmStrategyIdpracticeAtmNQ to see if that would make a difference (no apparent difference). I reset Sim101 again. The strategy still works but still leaves orders in a Cancel Pending state (see attached). I noticed an error message in the log regarding the section that says "You can change the stop price" which I have now commented-out to see if that is what is causing the problem.
My PracticeAtmStrategy is basically the same as the SampleAtmStrategy except that I changed the EntryLong/EntryShort orders to CrossAbove/CrossBelow (instead of Low[0]) and changed the AtmStrategyTemplate to AtmStrategyTemplateNQ.
Does atmStrategyId need to be a unique field for each ATM strategy? I have two others that aren't working either and I am trying to figure this out.
Thanks again.
Comment
-
Hello JohnS52,
Thank you for the screenshots.
To confirm, you still saw the stuck orders when testing SampleAtmStrategy with your atm strategy template correct?
If you change "STOP1" to "Stop1" are you still seeing the same error? Similar to how it is used in the code snippet from the method's Help Guide page:
Yes, the atmStrategyID is a unique identifier for the ATM strategy.
Please let me know if I can assist further.Gaby V.NinjaTrader Customer Service
Comment
-
I'm catching on. It appears that NinjaTrader sets the unique atmStrategyID for each order - or is there a way to use a get-set method to do it myself?
Also, as long as AtmStrategyTemplate is found in the AtmStrategy Templates folder, apparently it is not required to use that Atm Template with the strategy: any template will work fine. Is that true?
Last edited by JohnS52; 03-30-2024, 05:23 AM.
Comment
-
Gaby V.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,403 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
94 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment