I am a newbee with NinjaTrader and am having a hard time getting started.
I wrote the following basic code. It just prints when the various functions are called.
1) I connect to my data provider,
2) then create a chart.
3) Add the data series "6S 06-13".
4) Open the output window
5) Then I add my strategy "PivotInputTester".
- I get the Initialize print statement running twice and the OnBarUpdate or the OnStartUp are never called.
Any Ideas?
Cheers,
Cleo
publicclass PivotInputTester : Strategy
{
///<summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
///</summary>
protectedoverridevoid Initialize()
{
CalculateOnBarClose = true;
Print("Initialize");
}
protectedoverridevoid OnStartUp()
{
// Set any variables or logic you wish to do only once at start of your indicator/strategy
Print("OnStartUp");
// double test = Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).S1[0];
// double value = Pivots(PivotRange.Daily, HLCCalculationMode.CalcFromIntradayData, 0, 0, 0, 20).PP[0];
//Print("The Initialize Pivots' pivot value is " + value.ToString());
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
Print("On Bar Update");
}
Comment