PDA

View Full Version : Print does not create text in Output Window


Gwaihir
12-29-2009, 03:21 AM
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


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
}
}

NinjaTrader_Bertrand
12-29-2009, 03:28 AM
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?

Gwaihir
12-29-2009, 03:37 AM
Gwaihir, welcome to the forums at NT - did you open the output windows before you started the strategy / backtest?

Yes


Any errors being thrown to the log tab?

No
:eek:

Gwaihir
12-29-2009, 04:14 AM
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.

NinjaTrader_Bertrand
12-29-2009, 04:17 AM
Correct and thanks for the suggestion Gwaihir.