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
Enter OCO Order?
Collapse
X
-
Hello calebsandfort,
Thanks for your post and welcome to the NinjaTrader forums!
In the Managed Approach, under the "Internal Order Handling Rules that Reduce Unwanted Positions", under the "Methods that generate orders to enter a position will be ignored if:" there is this applicable rule: The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction Reference link: https://ninjatrader.com/support/help...d_approach.htm
Staying with the managed approach, you could replace the limit orders with code that checks the price against the two entry levels and then when price hits either level place a market order to fill immediately. You would want to run this part of your code in the calculate mode of OnEachTick.
For example:
if (your conditions to enter )
{
double limitPrice = ask - (2 * TickSize);
double stoplimitPrice = ask + (2 * TickSize)
if (Close[0] <= limitPrice || Close[0] >= stoplimitPrice)
{
EnterLong();
}
}
Notes: When using Calculate.OnEachTick, Close[0] = current price. You would need additional logic to control the flow to limit to one entry.
Alternatively, you could use the Unmanaged approach which does not restrict orders.
-
Enter OCO Order?
Hi
Using managed orders can I do something like:
Code:EnterLongLimit(1, ask - (2 * TickSize), "ENTER"); EnterLongStopMarket(1, ask + (2 * TickSize), "ENTER");
Do I have to use unmanaged orders?
Any help would be appreciated.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by mly916, Today, 09:48 PM
|
0 responses
6 views
0 likes
|
Last Post
by mly916
Today, 09:48 PM
|
||
Started by Mikey_, Today, 09:21 PM
|
0 responses
10 views
0 likes
|
Last Post
by Mikey_
Today, 09:21 PM
|
||
Started by cre8able, Today, 05:53 PM
|
3 responses
13 views
0 likes
|
Last Post
by cre8able
Today, 09:20 PM
|
||
Started by Aryan Kumar, Today, 09:04 PM
|
0 responses
4 views
0 likes
|
Last Post
by Aryan Kumar
Today, 09:04 PM
|
||
Started by yertle, Yesterday, 05:49 PM
|
3 responses
16 views
0 likes
|
Last Post
by Mindset
Today, 08:38 PM
|
Leave a comment: