I am using a demo account and the chart has delayed data. I wonder I have to open an account to have live data in order to have the strategy working? I did check "Enable" when I add the strategy to the chart.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Unable to get breakpoint hit in Visual studio
Collapse
X
-
Unable to get breakpoint hit in Visual studio
I have experience creating a custom indicator that could be hit by the break point in visual studio. Now I take most of the code in the indicator to create a strategy. I added the strategy to the chart. The breakpoint in Visual studio is not being hit in the onBarUpdate method.
I am using a demo account and the chart has delayed data. I wonder I have to open an account to have live data in order to have the strategy working? I did check "Enable" when I add the strategy to the chart.
Tags: None
-
Hello zehua,
In visual studio is the breakpoint shown as red or a hollow red ring?
This may depend on where the breakpoint is, you should be able to still hit historical bar breakpoints during historical processing, in realtime you would need live data to have the strategy process normally and place orders.
-
Hi Jesse,Originally posted by NinjaTrader_Jesse View PostHello zehua,
In visual studio is the breakpoint shown as red or a hollow red ring?
This may depend on where the breakpoint is, you should be able to still hit historical bar breakpoints during historical processing, in realtime you would need live data to have the strategy process normally and place orders.
I am using the demo account that has delayed data. I don't need real time order placement at this moment. i just would like to use historical data to backtest my strategy. The breakpoint was initially hollow, but after I right clicked, settings, allow breakpoint to be hit even if source code is different, then it turns solid. That was the same setting I used when developing indicators, so it should be fine. The breakpoint I set was at the first line of OnBarUpdate method. When I was developing indicators, that totally worked. I wonder if it didn't work when I applied to the strategy was because my account receives delayed data so it would only work on historical data? If that's the case, how do I let the strategy run for historical data?
Thanks,
Zehua
Comment
-
Hello zehua,
Debugging strategies works the same as indicators. I just tried setting a breakpoint in the SampleMACrossOver strategy that comes with the platform on the first line of code in OnBarUpdate and that was hit on bar 0. Do you have debug mode enabled in the NinjaScript editor and have you compiled with that enabled?
Comment
-
I try to load the SampleMACrossOver strategy to confirm it works. But this time, somehow the Enabled checkbox is disabled. I cannot enable it.Originally posted by NinjaTrader_Jesse View PostHello zehua,
Debugging strategies works the same as indicators. I just tried setting a breakpoint in the SampleMACrossOver strategy that comes with the platform on the first line of code in OnBarUpdate and that was hit on bar 0. Do you have debug mode enabled in the NinjaScript editor and have you compiled with that enabled?
Again, I am using the demo account with delayed data. Not sure how much that matters.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
51 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
128 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment