Initialize:
Add(ES 06-10,BarsPeriod.Id,BarsPeriod.Value); /* Add our blank placeholder indicators. The parameter we pass in is used to distinguish the two indicators from each other. */ Add(StrategyPlot(0)); Add(StrategyPlot(1)); // Set the color for the indicator plots StrategyPlot(0).Plots[0].Pen.Color = Color.Blue; StrategyPlot(1).Plots[0].Pen.Color = Color.Green; // Set the panel which the plots will be placed on. 1 = price panel, 2 = panel under the price panel, etc. StrategyPlot(0).PanelUI = 2; StrategyPlot(1).PanelUI = 2;
if (Times[0][0]==Times[1][0])
{
ratio.Set(Closes[0][0]/Closes[1][0]);
ma = SMA(ratio,ratioAverage)[0];
// plot ratio and average
StrategyPlot(0).Value.Set(ratio[0]);
StrategyPlot(1).Value.Set(ma);
}

Comment