Just as koganam said, you will get different entries 99.9% of the time if switching from market to limit orders. This is to be expected.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
EMA cross
Collapse
X
-
I can't paste the whole code becouse of character amount limit. Those two were inputs for offsetting entries (one for long one for short):
#region Variables
// Wizard generated variables
privateint of_L = 0; // Default setting for Of_L
privateint of_S = 0; // Default setting for Of_S
// User defined variables (add any user defined variables below)
#endregion
Comment
-
mateo, there is definitely a difference with using limit orders vs market orders. As I mentioned before, you are now submitting the orders to the close of the current bar (if the offsets = 0), which is not the same as the open of the next bar where the market order would be filled.AustinNinjaTrader Customer Service
Comment
-
So the only way to submit order at the next bar open is to use market replay ? I guess that's a lot of custom coding : ( Can you please show me a piece of code that's doing similar thing so I can use it as a reference ? Also, do you happen to know if I'd have the same proble trying to code it in TradeStation EasyLanguage ?? Thanks
Comment
-
As stated earlier in the thread, I would say pretty much: "yes".Originally posted by mateo321 View PostSo the only way to submit order at the next bar open is to use market replay ? I guess that's a lot of custom coding : ( Can you please show me a piece of code that's doing similar thing so I can use it as a reference ? Also, do you happen to know if I'd have the same proble trying to code it in TradeStation EasyLanguage ?? Thanks
You would use FirstTickOfBar, and CalculateOnBarClose = false together.
CalculateOnBarClose = false will ensure that every tick is updated in real time, and at FirstTickOfBar, axiomatically, Close[0] = Open[0] = High[0] = Low[0].
Comment
-
Hello,
Run the market replay connection and get the live data playing back then use one of these techniques to run a strategy as if it was live. You would then have to play the time you wanted to test back like it was live. You can play it at up to 500x live speed to get faster results. This would be exactly like if you where running the strategy on live markets. Instead your doing it on the replay connection.
Let me know if I can be of further assistance.BrettNinjaTrader Product Management
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
666 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
376 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment