Set the 'Parameter type' to Price, set the price to 99999
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
Order rejected
Collapse
X
-
-
Hello OldHatNoobCoder,
This is showing the limit was rejected due to the OCOID. To confirm you are not submitted the replacement order through the account correct?
If so, this is showing that even without submitting the order through the account the same error is occurring, and further shows with live orders your broker isn't rejecting orders that re-use OCOIDs from rejected/cancelled/filled orders and has different behavior than the Sim101 (or how NinjaTrader Brokerage works).Chelsea B.NinjaTrader Customer Service
Comment
-
-
I changed the ordering of GetAtmStrategyStopTargetOrderStatus() and I was able to produce this error:
Comment
-
Hello OldHatNoobCoder,
This occur typically occurs if this method is called before the entry order as filled and the Atm has become active. The warning in orange can be ignored if you are intentionally checking the stop and target status before the entry has filled and the Atm is active.Chelsea B.NinjaTrader Customer Service
Comment
-
Hmm. When I place it later, nothing at all happens.
Code:// If the status call can't find the order specified, the return array length will be zero otherwise it will hold elements if (status.GetLength(0) > 0) { Print("The entry order average fill price is: " + status[0]); Print("The entry order filled amount is: " + status[1]); Print("The entry order order state is: " + status[2]); // If the order state is terminal, reset the order id value if (status[2] == "Filled" || status[2] == "Cancelled" || status[2] == "Rejected") orderId = string.Empty; } } // If the stop order has been rejected, submit a new sell order if (atmStrategyId.Length > 0) { bool stopOrderRejected = false; string[,] stopOrders = GetAtmStrategyStopTargetOrderStatus("STOP1", atmStrategyId); if (stopOrders.Length > 0) { for (int i = 0; i < stopOrders.GetLength(0); i++) { if (stopOrders[i, 2].ToString() == "Rejected") { stopOrderRejected = true; Print ("Stop order rejected mofo "); break; } } } if (stopOrderRejected) { double limitPrice = Close[0] - 10 * TickSize; Order newLimitOrder = myAccount.CreateOrder(myInstrument, OrderAction.Sell, OrderType.Limit, OrderEntry.Automated, TimeInForce.Day, 1, limitPrice, 0, string.Empty, "NewLimitOrder", Core.Globals.MaxDate, null); Account.Submit(new[] { newLimitOrder }); } // If the strategy has terminated reset the strategy id else if (atmStrategyId.Length > 0 && GetAtmStrategyMarketPosition(atmStrategyId) == Cbi.MarketPosition.Flat) atmStrategyId = string.Empty;
Comment
-
This occur typically occurs if this method is called before the entry order as filled and the Atm has become active. The warning in orange can be ignored if you are intentionally checking the stop and target status before the entry has filled and the Atm is active.Code:// If the order state is terminal, reset the order id value
Comment
-
Hello OldHatNoobCoder,
By 'place it later' do you mean you are calling the method later in time, or do you mean you are calling the method lower in the code? (An a new bar update would be later in time. lower in the code would be at the same time)
Before calling this are you checking that the GetAtmStrategyEntryOrderStatus() is returning as Filled?Chelsea B.NinjaTrader Customer Service
Comment
-
By 'place it later' do you mean you are calling the method later in time, or do you mean you are calling the method lower in the code?
Yes, just didn't paste that:
Code:string[] status = GetAtmStrategyEntryOrderStatus(orderId); // If the status call can't find the order specified, the return array length will be zero otherwise it will hold elements[QUOTE][/QUOTE]
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by LiamTwine, Today, 08:10 AM
|
0 responses
2 views
0 likes
|
Last Post
by LiamTwine
Today, 08:10 AM
|
||
Started by Balage0922, Today, 07:38 AM
|
0 responses
5 views
0 likes
|
Last Post
by Balage0922
Today, 07:38 AM
|
||
Started by JoMoon2024, Today, 06:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by JoMoon2024
Today, 06:56 AM
|
||
Started by Haiasi, 04-25-2024, 06:53 PM
|
2 responses
19 views
0 likes
|
Last Post
by Massinisa
Today, 05:32 AM
|
||
Started by Creamers, Today, 05:32 AM
|
0 responses
6 views
0 likes
|
Last Post
by Creamers
Today, 05:32 AM
|
Comment