I was testing an strategy with two instruments and it always crashed when I used it on a chart while connected and also with history data.
I suposed it was anything wrong in my code but after several tests and differents codes I can prove it's a problem with multiinstruments strategy and order handling problem of NT.
Please try this two examples with a history chart (not strategy analizer) of not less than three months 5 minutes bars:
1.- With only one instrument
protected override void Initialize()
{
y=10;
ExitOnClose=false;
}
protected override void OnBarUpdate()
{
if (y==x) {
EnterLong(0, 1, "IN1." + counter);
x=0;
counter++;
}
x++;
}
and before running this strategy modify the parameter Entries per direction = 100, it works fine but:
2.- try the same with:
protected override void Initialize()
{
y=10;
ExitOnClose=false;
Add("YC 12-10", BarsPeriod.Id, BarsPeriod.Value);
}
protected override void OnBarUpdate()
{
if (BarsInProgress == 1) return;
if (y==x) {
EnterLong(0, 1, "IN1." + counter);
EnterShort(1, 1, "IN2." + counter);
x=0;
counter++;
}
x++;
}
and before running this strategy modify the parameter Entries per direction = 100
It crashes when running a new plotted bar (live)
It seems there's an internal variable within NT that gets outbounded when trading with several instruments, could you test it?
Thank you very much

Comment