Hello,
I'm trying to hide the VWAP plot prior to the StartBar boolean. I've tried to use the SetHiding for the VWAP plot but it doesn't seem to be working. Any suggestion?
I'm trying to hide the VWAP plot prior to the StartBar boolean. I've tried to use the SetHiding for the VWAP plot but it doesn't seem to be working. Any suggestion?
Code:
input startTime = 930;
input startDate = 20230111;
def startTimez = SecondsFromTime(startTime)==0;
def startDatez = (startDate == GetYYYYMMDD());
def startBar = startDatez and startTimez;
def volumeSum;
def volumeVwapSum;
def volumeVwap2Sum;
if (startBar) {
volumeSum = volume;
volumeVwapSum = volume * vwap;
volumeVwap2Sum = volume * Sqr(vwap);
} else {
volumeSum = compoundValue(1, volumeSum[1] + volume, volume);
volumeVwapSum = compoundValue(1, volumeVwapSum[1] + volume * vwap, volume * vwap);
volumeVwap2Sum = compoundValue(1, volumeVwap2Sum[1] + volume * Sqr(vwap), volume * Sqr(vwap));
}
def price = volumeVwapSum / volumeSum;
plot VWAP = price;
VWAP.setDefaultColor(getColor(0));