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 NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
75 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
146 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
79 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
50 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
54 views
0 likes
|
Last Post
|

Comment