NexusFi: Find Your Edge


Home Menu

 





Conditional breakpoints in Visual Studio debugging of NinjaScript


Discussion in NinjaTrader

Updated
    1. trending_up 1,138 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 1 attachments




 
 

Conditional breakpoints in Visual Studio debugging of NinjaScript

 
 swinger 
Raleigh NC/USA
 
Experience: Beginner
Platform: NinjaTrader
Trading: stocks
Posts: 33 since Oct 2014
Thanks Given: 212
Thanks Received: 16

Using NT7 and Visual Studio Community 2013.

I'm having trouble with conditional breakpoints. Hit count breakpoints work fine, so I think I must be entering the condition incorrectly. For example, if I'm trying to break execution when CurrentBar is 100, I've tried the following:

CurrentBar == 100 (gets executed through without stopping)
"CurrentBar" == 100 (error msg)
CurrentBar = 100 (error msg)
"CurrentBar == 100" (error msg)

Can you see where I'm going wrong?

Edit: So it's not a syntax problem. It simply won't work using CurrentBar. An easy solution is to declare a local variable and set it equal to CurrentBar; then create a conditional breakpoint using that variable.

Started this thread

Can you help answer these questions
from other members on NexusFi?
Deepmoney LLM
Elite Quantitative GenAI/LLM
Are there any eval firms that allow you to sink to your …
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
 
 
fx.practic's Avatar
 fx.practic 
Ukraine, Kharkiv
 
Experience: Beginner
Platform: NinjaTrader
Broker: oanda.com
Trading: GBP/USD
Posts: 17 since Aug 2009
Thanks Given: 9
Thanks Received: 7


Yeh.

I tried this:

 
Code
			int day = Time[0].Day;
			int hour = Time[0].Hour;
			int minute = Time[0].Minute;
			int second = Time[0].Second;
						
			bool hb = Time[0].Day == 31 &&  Time[0].Hour == 21 && Time[0].Minute == 2 && Time[0].Second >= 26;
and condition You can see in attach.

This variant work quick, gives no error, but program don't stop at breakpoint!!

Attached Thumbnails
Click image for larger version

Name:	Visual Studio BP.png
Views:	126
Size:	5.5 KB
ID:	229835  

 



Last Updated on March 18, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts