Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trouble parametres Developing stretegy
Collapse
X
-
Hello simonerg,
Thanks for your post.
The error message is pretty clear that you are submitting a buy stop (market or limit) order below the current price which results in a rejected order which then disables the strategy.
You would need to correct your strategy coding so that is does not do that.
As we do not know how you have coded your strategy, we could not provide further specific advise.
If you do not wish to share or show your strategy coding in a public forum, please feel free to send it into PlatformSupport[at]NinjaTrader[dot]Com. Mark the e-mail Atten Paul and Ticket#2242523 and include a link to this thread for reference. In addition, include your strategy file which can be found in Documents>NinjaTrader8>bin>Custom>Strategies> and it will have the same name as your strategy.
In most cases, you will want to debug your strategy (we do not provide debugging services), here is a link to our debugging tips which may get you started: https://ninjatrader.com/support/help...script_cod.htm Most likely you will want to compare the stop price you are using to the current price.
- Likes 1
-
Hello simonerg,
Thanks for your reply, glad we were able to help.
For readers of this thread, the issue was created by unexpected entry orders which related to the use of Calculate.OnEachTick. The strategy is run on each tick and when the entry conditions were true they remained true for many ticks thus placing many orders. While the EntriesPerDirection was set to 1, in this OnEachTick mode, the strategy is run before the position can be updated to prevent further orders. The issue was solved by adding an int variable to store the bar number of the bar where the first entry order was placed and in the entry conditions, checking to see that the CurrentBar is not equal to the saved bar number. Example:
if (Entry conditions && CurrentBar != savedBar)
{
// place order here
savedBar = CurrentBar; // store the entry bar
}
Other solutions would be to use a bool variable that is set when the 1st entry occurs and checking the state of the bool as an entry condition, however this would require an addition set of conditions to "reset" the bool to allow for subsequent entries.
- Likes 1
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
41 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
124 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
64 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
41 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|


Comment