Strategy 'MyCustomStrategy/-1': An order has been ignored since the stop price ‘4522.75’ near the bar stamped ‘09/11/2023 10:12:21’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Optimization log message saying An order has been ignored since the stop price....
Collapse
X
-
Optimization log message saying An order has been ignored since the stop price....
I am running Optimization on my custom strategy and I noticed the Logs window is filled with messages like the one below. I am unsure why this happening.
Code:
Tags: None
-
Hello wzgy0920,
Thank you for your post.
The message is letting you know that a stop order was ignored because the strategy submitted the order to an invalid price level. Buy stop orders must be placed above the current ask price. Sell stop orders must be placed below the current ask price.
When the order is submitted, is the stop price parameter greater than the GetCurrentAsk() for a buy stop order? Or, is the stop price parameter less than the GetCurrentAsk() for a sell stop order?
I recommend you add prints to the strategy to determine why the stop order is being ignored. One line above where the stop order is placed, print the GetCurrentAsk() and print the price being submitted to the order method.
Below is a link to a forum post that demonstrates using prints to understand behavior.
https://ninjatrader.com/support/foru...121#post791121
Please see the help guide documentation below for more information about GetCurrentAsk().
https://ninjatrader.com/support/help...currentask.htm
Please also note that there is no intrabar movement with historical processing. If the strategy is using Standard Order Fill Resolution, it will create "virtual bars" based on the OHLC of the next bar to simulate how market data moved and then fill the order.
This error could be resolved by adding intrabar granularity to your strategy or setting Order Fill Resolution to High (or both).
Please see this forum post below which goes over the differences between Historical vs. real-time and implementing intra-bar granularity:
https://forum.ninjatrader.com/forum/...ive#post773377
If you have any other questions, please let me know.Gaby V.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_Gaby View Post
Please also note that there is no intrabar movement with historical processing. If the strategy is using Standard Order Fill Resolution, it will create "virtual bars" based on the OHLC of the next bar to simulate how market data moved and then fill the order.
This error could be resolved by adding intrabar granularity to your strategy or setting Order Fill Resolution to High (or both).
Please see this forum post below which goes over the differences between Historical vs. real-time and implementing intra-bar granularity:
https://forum.ninjatrader.com/forum/...ive#post773377
An unrelated question, I have another thread where I reported incorrect results based on the value of IsInstantiatedOnEachOptimizationIteration. Is there any other specifics I should know about Optimization that will help me troubleshoot that issue?
Comment
-
Order Fill Resolution set to standard will only calculate bars based on the OHLC and will not place orders within the bar (no intra bar movement).
Since you have your strategy set to Calculate.OnPriceChange, you will need to enable tick replay and implement 1-tick intra-bar granularity in order to have intrabar movement.
As for your IsInstantiatedOnEachOptimizationIteration question, Chelsea will follow up about that in your other thread.
Please let me know if you have any other questions.
Gaby V.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Peppo, 04-13-2025, 12:59 PM
|
11 responses
88 views
0 likes
|
Last Post
![]()
by Peppo
Today, 12:15 PM
|
||
Started by michelz, 02-18-2025, 08:30 AM
|
31 responses
1,018 views
0 likes
|
Last Post
![]()
by rockmanx00
Today, 11:55 AM
|
||
Started by TraderYoda, 05-24-2019, 03:33 AM
|
43 responses
2,119 views
1 like
|
Last Post
![]()
by pwmmmm
Today, 11:53 AM
|
||
Started by jb805, 02-04-2025, 12:34 PM
|
5 responses
168 views
0 likes
|
Last Post
![]()
by Swagpapifrio
Today, 11:47 AM
|
||
Started by Newtrader101, Today, 11:27 AM
|
1 response
6 views
0 likes
|
Last Post
|
Comment