If I have my entry order condition how I want it, can I call the AtmStrategy and orStopStrategy
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
Add AtmStrategy StopStrategy to my strategy entries
Collapse
X
-
To be more explicit and easier to answer.
I can enter long on criteria but I do not know how to invoke the AtmStrategyCreate properly
EnterLong works
ApplyATMLong Does not work
if (CrossAbove(GetCurrentAsk(0), MyEntryCriteria, 1))
{
EnterLong(Convert.ToInt32(DefaultQuantity), "");
//ApplyATMLong();
}
}
protected void ApplyATMLong(){
atmStrategyId = GetAtmStrategyUniqueId();
atmStrategyOrderId = GetAtmStrategyUniqueId();
AtmStrategyCreate( OrderAction.Buy,
OrderType.Market, 0, 0,
TimeInForce.Day,
atmStrategyOrderId,
"MyAtmStrategy",
atmStrategyId, (atmCallbackErrorCode, atmCallbackId) =>
{
if (atmCallbackId == atmStrategyId) /// checks that the call back is returned for the current atmStrategyId stored
{
if (atmCallbackErrorCode == Cbi.ErrorCode.NoError) /// check the atm call back for any error codes
{
isAtmStrategyCreated = true; /// if no error, set private bool to true to indicate the atm strategy is created
}
}
});
}​
-
Hello BartMan,
Thanks for your post.
Atm Strategy Methods would be used to place an entry order with protective orders attached that are handled by an Atm Strategy Template using the AtmStrategyCreate() method.
Atm Strategy Methods: https://ninjatrader.com/support/help...gy_methods.htm
AtmStrategyCreate: https://ninjatrader.com/support/help...tegycreate.htm
The SampleAtmStrategy script that comes default with NinjaTrader could be viewed for an example of how Atm Strategy Methods can be used in a NinjaScript Strategy. To view the script, open a New > NinjaScript Editor window, open the Strategies folder, and double-click on the SampleAtmStrategy file.
Using ATM Strategies in NinjaScript: https://ninjatrader.com/support/help...strategies.htm
Let me know if I may assist further.Brandon H.NinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by jackiegils, Yesterday, 11:05 PM
|
1 response
9 views
0 likes
|
Last Post
by marcus2300
Today, 03:06 PM
|
||
Started by Skifree, Today, 02:50 PM
|
0 responses
8 views
0 likes
|
Last Post
by Skifree
Today, 02:50 PM
|
||
Started by owen5819, Today, 02:24 PM
|
1 response
9 views
0 likes
|
Last Post
by owen5819
Today, 02:49 PM
|
||
Started by Skifree, 05-07-2024, 11:38 PM
|
2 responses
28 views
1 like
|
Last Post
by Skifree
Today, 02:46 PM
|
||
Started by OllieFeraher, 05-09-2024, 11:14 AM
|
4 responses
15 views
0 likes
|
Last Post
by MisterTee
Today, 02:19 PM
|
Comment