I am trying to code an strategy that uses cumulativeDelta from NQ and also from a secondary serie as MNQ. The lines would be:
public class NQ60ORMNQ : Strategy
{
private OrderFlowCumulativeDelta cumulativeDelta;
private OrderFlowCumulativeDelta cumulativeDelta1;
......
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
DeltaLimit = 75;
DeltaLimit2 = 115;
......
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, 1);
AddDataSeries("MNQ 12-20", Data.BarsPeriodType.Tick, 1, Data.MarketDataType.Last);
}
else if (State == State.DataLoaded)
{
cumulativeDelta = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAs k, CumulativeDeltaPeriod.Bar, 0);
cumulativeDelta1 = OrderFlowCumulativeDelta(BarsArray[4], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0);
}
protected override void OnBarUpdate()
if (BarsInProgress == 1 && BarsInProgress == 2)
{
cumulativeDelta.Update(cumulativeDelta.BarsArray[1].Count - 1, 1);
cumulativeDelta1.Update(cumulativeDelta1.BarsArray[2].Count - 1, 1);
}
// Set 1
if (cumulativeDelta.DeltaHigh[1] > DeltaLimit || cumulativeDelta1.DeltaHigh[0] > DeltaLimit2)
{
if (BarsInProgress == 0)
{ "Several Conditions"
Any idea what is wrong there? How can I call second instrument cumulativeDelta?
Comment