I am trying to create a strategy where I can instantiate other strategies and have them run.
This is my code. It actually gives an error but after ignoring it, it runs but only with the saved default settings. I should be able to change them.
#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
namespace NinjaTrader.Strategy
{
public class MultiStrategyTest : Strategy
{
protected override void Initialize()
{
CalculateOnBarClose = false;
Unmanaged = true;
MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
BarsRequired = 0;
IncludeCommission = true;
Slippage = 1;
ConnectionLossHandling = ConnectionLossHandling.KeepRunning;
RealtimeErrorHandling = RealtimeErrorHandling.TakeNoAction;
ExitOnClose = false;
MultiThreadSupport = false;
}
public StrategyBase st1;
protected override void OnStartUp()
{
if (st1 == null)
{
st1 = new NinjaTrader.Strategy.CoreOne();
st1.Account = this.Account;
st1.CalculateOnBarClose = this.CalculateOnBarClose;
st1.BarsRequired = this.BarsRequired;
st1.FillType = this.FillType;
st1.Slippage = this.Slippage;
st1.BackTestFrom = this.BackTestFrom;
st1.BackTestTo = this.BackTestTo;
st1.BackTestMode = this.BackTestMode;
st1.IncludeCommission = this.IncludeCommission;
st1.MaximumBarsLookBack = this.MaximumBarsLookBack;
st1.ExitOnClose = this.ExitOnClose;
st1.TimeInForce = this.TimeInForce;
st1.Instrument = this.Instrument;
st1.SetBarsPeriodInstrument(this.Bars.Period, this.Instrument);
st1.SetUp();
}
if (!st1.Enabled) st1.Enabled = true;
if (!st1.Running) st1.Running = true;
}
protected override void OnTermination()
{
if (st1 != null)
{
st1.Dispose();
st1 = null;
}
}
protected override void OnBarUpdate()
{}
}
}
I'll be waiting for your suggestions, thanks in advance.

So it is quite OK.
Comment