David
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
sample atm strategy mod
Collapse
X
-
sample atm strategy mod
Hi, I'm working with the sample atm strategy. I'm not sure if this is the right place to ask, but perhaps you could set me on the right path. I'd like to make a copy of the sample atm strategy that comes with NT8 and add a condition which cancels the current entry order if the market moves x ticks away from my order. Any help appreciated.
DavidTags: None
-
Hello trader3000a,
Thanks for your post.
If you would like to modify the SampleAtmStratetgy strategy, you would need to first create a copy of the strategy. To do so, open a New > NinjaScript Editor window, open the Strategies folder, select SampleAtmStrategy, right-click in the strategy code, select 'save as', name the new copy of the strategy, and click OK. Then, once a copy of the strategy has been made, you could modify it in the NinjaScript Editor window.
The AtmStrategyClose() method would be used to cancel any working orders and close any open position of a strategy using the default ATM strategy close behavior. Something you could do is save the average fill price of the entry order to a variable. Then you could create a condition that checks if the Close[0] price is greater than the variable plus say 5 ticks (5*TickSize) and call AtmStrategyClose(). This would check if the current close is greater than the entry order's average fill price + 5 ticks and calls AtmStrategyClose() to cancel working orders and close open positions.
See the help guide page below for more information.
AtmStrategyClose() - https://ninjatrader.com/support/help...ategyclose.htm
Also, here is a link to our publicly available training video, 'NinjaScript Editor 401', for you to view at your own convenience.
NinjaScript Editor 401 - https://youtu.be/H7aDpWoWUQs?list=PL...We0Nf&index=14
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
53 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
70 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment