NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 08-13-2010, 09:47 AM   #1
Lost Trader
Senior Member
 
Join Date: Oct 2007
Location: Tucson, AZ
Posts: 368
Thanks: 2
Thanked 2 times in 2 posts
Default Print doesn't print when CurrentBar ==0

I've noticed this before in 6.5 ... If I have something like
Code:
if (CurrentBar == 0) 
{ 
                Value.Set(0); TR = Instrument.MasterInstrument.Round2TickSize((High[0]+Low[0]+Close[0])/3); return; 
                Print(header +" INIT Start value = " + TR);
 }
The output does NOT show in the output window.
No print statements in the CB==0 block ever show in the output window.

Seems like they should.
Lost Trader is offline  
Reply With Quote
Old 08-13-2010, 09:52 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello Lost Trader,

This most likely has to do with your return; statement before print. Let us know if you are able to see output when this is moved to the other side.

Code:
 { 
                Value.Set(0); TR = Instrument.MasterInstrument.Round2TickSize((High[0]+Low[0]+Close[0])/3); 
                Print(header +" INIT Start value = " + TR);
                return; 
 }
NinjaTrader_RyanM is offline  
Reply With Quote
Old 08-13-2010, 09:54 AM   #3
Lost Trader
Senior Member
 
Join Date: Oct 2007
Location: Tucson, AZ
Posts: 368
Thanks: 2
Thanked 2 times in 2 posts
Default

Oh dear -- I was just trying to to delete my note! Man I am being stupid lately!
Thanks Ryan, sorry to have bothered you.
Lost Trader is offline  
Reply With Quote
Old 08-13-2010, 10:03 AM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

No problem - sometimes the answers stare at us for awhile before we notice.
NinjaTrader_RyanM is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Print StopLoss value Shansen Strategy Development 3 04-26-2009 09:13 AM
Print() duck_CA Strategy Development 2 03-07-2009 01:18 PM
Print to Output heech Strategy Development 3 11-15-2008 07:41 PM
Print() help frogzillafx Indicator Development 5 10-21-2008 10:26 AM
Print() WDieter General Programming 2 05-23-2008 10:55 AM


All times are GMT -6. The time now is 05:54 PM.