So far, I have achieved this but the rectangle drawn on the 5 min timeframe is anchored 2 candles in the future. How to reflect the same 15 min candle onto the 5 min candle?
Also, would like to push the rectangle to the back and if possible make the line as thin as a wick width.
Attached picture.
Thanks
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Strategy here.";
Name = "DIVERGENCE";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DrawOnPricePanel = true;
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
}
else if (State == State.Configure)
{
AddDataSeries("EURUSD", Data.BarsPeriodType.Minute, 15, Data.MarketDataType.Last);
AddDataSeries("GBPUSD", Data.BarsPeriodType.Minute, 15, Data.MarketDataType.Last);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[1] < 1
|| CurrentBars[2] < 0)
return;
// Set 1
if ((Opens[1][0] < Closes[1][0])
&& (Opens[2][0] > Closes[2][0]))
{
Draw.Rectangle(this, Convert.ToString(CurrentBars[1]), false, 0, Lows[1][0], 3, Highs[1][0], Brushes.OliveDrab, Brushes.OliveDrab, 0);
}

Comment