I currently have a script that addresses these instruments
{
AddDataSeries("NQ 03-24", Data.BarsPeriodType.Tick, 300, Data.MarketDataType.Last);
AddDataSeries("NQ 03-24", Data.BarsPeriodType.Tick, 1000, Data.MarketDataType.Last);
AddDataSeries("ES 03-24", Data.BarsPeriodType.Tick, 300, Data.MarketDataType.Last);
AddDataSeries("ES 03-24", Data.BarsPeriodType.Tick, 1000, Data.MarketDataType.Last);
}
So NQ 03-24 300 tick is index 0.
NQ 03-24 1000 tick is index 1, etc...
Further down I define a MACD for the first two intruments
MACD2 = MACD(Closes[1], 12, 26, 9); <--- this is the MACD for NQ 1000 tick
Then I use these MACD's in my code in an attempt to paint the background light green when the NQ1000 MACD is Positive and rising.
&&(MACD2.Diff[0] > 0))
{
BackBrush = Brushes.Honeydew;
}
So If I open an NQ 300 tick chart and enable this strategy (which has other sections that do things depending upon what the 300 tick is doing),
I get this odd result.
The background screen is painted according to what the 300 tick MACD is doing, instead of what the 1000 tick MACD is doing as specified.
No error is thrown.
What is the best way to proceed?
Thanks,
Comment