NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-29-2009, 03:21 AM   #1
Gwaihir
Junior Member
 
Join Date: Dec 2009
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default Print does not create text in Output Window

Hi,

new to the NT, so what am I missing here? None of the print statements below creates any output in the Output Window during a backtest run (which creates the expected results).

Best regards
Gwaihir

Code:
 
publicclass bidlowprice : Strategy
{
#region Variables
// Wizard generated variables
privateint sellDelay = 2; // Default setting for SellDelay
// User defined variables (add any user defined variables below)
#endregion
///<summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
///</summary>
protectedoverridevoid Initialize()
{
CalculateOnBarClose = false;
Print("XXX");
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
double diff = High[1] - Low[1];
Print("test");
Print(diff + " ," + High[0] + " ," + Low[0] + " ," + Low[1] + " ," + (Low[1] - diff));
if (High[0] > (Low[1] - diff)
&& Low[0] < (Low[1] - diff))
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (BarsSinceEntry() == SellDelay)
{
ExitLong("", "");
}
}
#region Properties
[Description("Delay before Stuff bought gets sold")]
[Category("Parameters")]
publicint SellDelay
{
get { return sellDelay; }
set { sellDelay = Math.Max(0, value); }
}
#endregion
}
}
Gwaihir is offline  
Reply With Quote
Old 12-29-2009, 03:28 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,393
Thanks: 252
Thanked 968 times in 951 posts
Default

Gwaihir, welcome to the forums at NT - did you open the output windows before you started the strategy / backtest?

Any errors being thrown to the log tab?
NinjaTrader_Bertrand is online now  
Reply With Quote
Old 12-29-2009, 03:37 AM   #3
Gwaihir
Junior Member
 
Join Date: Dec 2009
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Bertrand View Post
Gwaihir, welcome to the forums at NT - did you open the output windows before you started the strategy / backtest?
Yes

Quote:
Any errors being thrown to the log tab?
No
Gwaihir is offline  
Reply With Quote
Old 12-29-2009, 04:14 AM   #4
Gwaihir
Junior Member
 
Join Date: Dec 2009
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default

Ah, unlocking the code implies manually compiling it. Otherwise changes are ignored when the strategy is run. A tiny reminder like "strategy being backtested is not the one last saved" would be helpful though.
Gwaihir is offline  
Reply With Quote
Old 12-29-2009, 04:17 AM   #5
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,393
Thanks: 252
Thanked 968 times in 951 posts
Default

Correct and thanks for the suggestion Gwaihir.
NinjaTrader_Bertrand is online now  
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() to Output Window xewoox General Programming 3 09-04-2010 10:24 PM
Print Output Window data to named text file Buttermilk General Programming 1 09-17-2009 03:56 PM
Printing Text to Output Window on the Last Bar of a Chart ollywedgwood Strategy Development 2 07-24-2009 03:39 PM
Colored text in output window? heech Strategy Development 1 03-03-2009 10:02 AM
Output window text kenzo Strategy Analyzer 3 12-12-2008 10:30 AM


All times are GMT -6. The time now is 03:54 AM.