Attached the code lines waiting for help thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Backtesting Error
Collapse
X
-
Backtesting Error
Hello, I'm running my strategy on backtesting but I'm getting the following error : " Object reference not set to an instance of an object ". this error its only happening on backtesting, in Realtime it works perfect. The code is not entering the loop when it does the backtest, idk why.
Attached the code lines waiting for help thanksTags: None
-
Hello Sandra73,
DrawingObjects are not drawn during a backtest.
The ChartControl will be null until after the backtest is complete.
You can check the ChartControl is not null, the DrawObjects collection is not null, the variable myReg_reingreso is not null, etc.
Unfortunately, I don't have a link for a note on this in NinjaTrader 7, but I can provide a link to the help guide on DrawObjects.
Chelsea B.NinjaTrader Customer Service
- Likes 1
-
Hello ChelseaB;
I have no idea how I can fix this. I use Region EndAnchor.Price as a re-entry price level? But Draw Collection is null on backtesting, any way to draw object or access the levels of the region(Start/EndAnchor) to take them as a reference?
I'm using NT8
Thanks
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
128 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
73 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
116 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
109 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
88 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment