Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy taking different trades in live vs backtest/historical
Collapse
X
-
Strategy taking different trades in live vs backtest/historical
I'm testing out a very simple strategy to get the idea of how orders are submitted. My strategy uses/calculates OnBarClose and has a couple simple conditions. Very simple stuff such as if bar closes below a moving average, then place order. When I run a backtest, the orders looks OK. Same whenever I add it to a chart and look at the historical trades, everything looks fine. However, during live (sim) trading, the trades it placed do not fit any of the conditions. For example, the bar didn't close below the moving average but it still placed an order. In addition, as I understand it, if a market order were placed with OnBarClose, then it would likely fill at the open of the next bar. The historical data shows this but again on the live trades it took, the prices it entered on aren't near the open. The logs show that the order was initiated from the strategy. I understand that there would be discrepancies between historical and live but the fact that the trades were placed when it was simple conditionals that should have prevented it leaves me lost. Any thoughts would be appreciated. Thanks.Tags: None
-
Hello veetotheone,
Are you printing the values to the output window so that we can confirm?
If so, please save the output to a text file (right-click -> Save as) and attach this with your next post.
If not, use prints and TraceOrders to understand behavior.
Below is a link to a forum post that demonstrates using Print() to understand behavior and includes videos.
Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
88 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
134 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
68 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
119 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
69 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment