To troubleshoot, I've commented out sections of code, stored price values rounded to the ticksize and rounded number of contracts to integers. I even Print values and don't see anything weird When drawing text on the chart I converted the contact number to a string thinking that was the problem. I'm not sure where to go from here. The error doesn't show up on a consistent basis. I'm testing the strategy on Playback mode and typically need to move the fibs around manually on the chart before the strategy stops and I get the error. Any tips on how to troubleshoot this?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Value either too large or too small for an Int32
Collapse
X
-
Value either too large or too small for an Int32
I need help troubleshooting the error, "Value was either too large or too small for an Int32"? I have a strategy that puts fibs on a chart and places limit orders at a particular fib value (e.g. 55%). I also Draw.Text on the chart showing how many contracts would be traded based on risking a dollar amount beyond the fib level.
To troubleshoot, I've commented out sections of code, stored price values rounded to the ticksize and rounded number of contracts to integers. I even Print values and don't see anything weird When drawing text on the chart I converted the contact number to a string thinking that was the problem. I'm not sure where to go from here. The error doesn't show up on a consistent basis. I'm testing the strategy on Playback mode and typically need to move the fibs around manually on the chart before the strategy stops and I get the error. Any tips on how to troubleshoot this?Tags: None
-
Hello tak145,
Thank you for your post.
I would suggest narrowing down exactly which line of code is throwing the error and what the value you are trying to assign to this int variable is.
If you've already done the debugging by commenting out sections of code, which line of code is throwing the error?
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
32 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
195 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
356 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
277 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment