I would like to get the value of the VWMA line at the first moment of the bar, when the bar begins (when open==close1), or when close==open, and make it a point on chart.
Now when the price is changing, I want to do a comparison to see if that point is under or above the current line of VWMA.
//@version=4
VWMA = vwma(close, 20)
plot(VWMA, title='VWMA', color=red)
A similar code at Find 1st value WMA is showing almost what I need but it seems to be not really correct because WMA is not VWMA.
Can you please help me to modify the code from the above link to get the correct value for VWMA.
Thank you