Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
separate entry and exit strategy
Collapse
X
-
separate entry and exit strategy
I have an entry strategy that I like, but I would like to use an ATM Strategy to exit those positions. Is that even possible to get those to work together? And if so, how does that need to be set up to get that to work?Tags: None
-
It appears that the only way to utilize ATM Strategy is to include it into the programming of the strategy. So, it looks like using the SampleATM is best?
I'm not going to lay out the entry method here in public, so the best proxy for what I am doing is a simple 5/13 EMA crossover entry method.
if (orderId.Length == 0 && atmStrategyId.Length == 0 && Close[0] > Open[0])
{
isAtmStrategyCreated = false; // reset atm strategy created check to false
atmStrategyId = GetAtmStrategyUniqueId();
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(OrderAction.Buy, OrderType.Limit, Low[0], 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId, (atmCallbackErrorCode, atmCallBackId) => {
//check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId)
isAtmStrategyCreated = true;
});
}
Comment
-
Hello MojoFilter,
The SampleATMStrategy would be the suggested way to approach submitting atms from NinjaScript. For a strategy to be able to attach the ATM to the entry it would also need to submit the entry that has the ATM attached to it. We generally suggest to make a copy of that script by doing a right click save as so you have all of the required variables and logic to use the ATM through its lifetime. The only changes you would need to make would be your entry condition and the template name you wanted to use.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
116 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
61 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
40 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
43 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
82 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment