I tried both of the scripts below. Neither of them worked unfortunately. The scripts produced a blank screen. Any suggestions... I want the indicator to give me the closing price for the bar that is 20 bars before / ahead of the Maximum volume bar for that session. Thanks...
if (CurrentBar < 20)return;
double MaxVolume = 0;
double MaxPrice = 0.0;
for (int x = 0; x <= Bars.BarsSinceSession; x++)
{
if (Volume[x] > MaxVolume)
{
MaxVolume = Volume[x];
MaxPrice = Close[x + 20];
}}
Plot0.Set(MaxPrice);
double MaxVolume = 0;
double MaxPrice = 0.0;
for (int x = 0; x <= Bars.BarsSinceSession; x++)
{
if (Volume[x] > MaxVolume)
{
MaxVolume = Volume[x];
MaxPrice = Close[x + 20];
}}
Plot0.Set(MaxPrice);
Comment