I'm new to the NinjaTrader/Script platform and I'm trying to make a simple strategy using OBV. After I had completed my strategy I get a compile error on several different lines throughout the entire program, some falling under "Wizard Settings" in the code. I created the entire thing with the wizard and haven't changed anything in the actual code. The full code is below, up to line 67 where the Wizard Settings start. Thanks for your time and any help you can offer.
Regards,
TheProfitcy
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Buy when OBV crosses average, sell when it crosses below.
/// </summary>
[Description("Buy when OBV crosses average, sell when it crosses below.")]
public class OBVStrat : Strategy
{
#region Variables
// Wizard generated variables
private int positionSize = 500; // Default setting for PositionSize
// 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>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(OBV(), WMA(OBV(), 21), 1))
{
EnterLong(PositionSize, "Long");
}
// Condition set 2
if (CrossBelow(OBV(), WMA(OBV(), 21), 1))
{
EnterShort(PositionSize, "Short");
}
}
#region Properties
[Description("Shares To Buy/Sell")]
[GridCategory("Parameters")]
public int PositionSize
{
get { return positionSize; }
set { positionSize = Math.Max(100, value); }
}
#endregion
}
}

Comment