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
How to set limit price and stop price for AtmStrategyCreate() and StopLimit orderType
Collapse
X
-
How to set limit price and stop price for AtmStrategyCreate() and StopLimit orderType
I am not too sure how to set the limit price and stop price when using AtmStrategyCreate() and an orderType of StopLimit. Let's say the current price is at 3238.00 and I want to use AtmStrategyCreate() to sell at 3237.00 or better when the price touches 3237.00. How would I go about setting the limit price and stop price in such a case? Any help would be much appreciated.Last edited by mbesha; 01-07-2020, 10:37 AM. -
Hello mbesha,
If you are wanting to specifically set the price of your targets through code or customize them you should instead use one of the other strategy approaches like managed or unmanaged.
An ATM specifically has no options to control the targets because that is the purpose of your ATM strategy and what is defined in its template. To have the targets submitted you would just need to have the entry order fill. Once that happens whatever you had defined in the ATM template for the targets would be used. Those targets are not going to be managed by the NinjaScript strategy and will be unable to be modified through code.
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
-
Hi Jesse
I am not looking to control the target but the entry price. I understand that the stop loss, profit target and stop strategy are set in the template of the ATM strategy but my problem is that I am trying to use a managed approach by utilizing the AtmStrategyCreate() method and I am unsure how to set the limitPrice and stopPrice parameters especially for the StopLimit orderType. Please enlighten me on how to use these using the example I gave.
Comment
-
Hello mbesha,
but my problem is that I am trying to use a managed approach by utilizing the AtmStrategyCreate()
What is your specific question surrounding using the stop or limit prices? These would work the same as other Limit/stop type orders where you would enter a price in which you wanted the order to be at.
Are you asking how to calculate an offset from the close price? What specifically did you need help with in regard to the prices?
If you are not sure on how to use the values or the order they should go in I would suggest looking at a ChartTrader and then Right Click in the chart above or below the price. This will produce the types of orders which can be placed on that side of the market. This is helpful if you are not certain what order the prices should go in you can experiment by placing those type of orders and then looking in the Control center at what the stop and limit prices were.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
I've the same question as mbesha. I understand what his/her question is, which I think Jesse misses the question.
Using the eg from mbesha, if price is falling from above 3237, & use NT script AtmStrategyCreate(OrderAction.Sell, OrderType.StopLimit, limitPrice, 3237,...), one can't use a limitPrice (say, 3236) that is greater than the stopPrice (3237 here), otherwise will get a runtime error msg saying "Limit can't be greater than stop price".
Is there a way to get around this with AtmStrategyCreate?
Note that with manual trading using Chart Trader, one can achieve this effect by setting the "Predefined stop limit offset value" to a negative value.
Thanks for your help.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by aussugardefender, Today, 01:07 AM
|
0 responses
3 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
238 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
4 views
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
||
Started by pechtri, 06-22-2023, 02:31 AM
|
10 responses
125 views
0 likes
|
Last Post Today, 12:03 AM |
Comment