Hey Folks
This is probably a real noob question but I have been using the Cumulated volume velocity indicator from the library here for some time and find it excellent. I have been trying though to adapt it so instead of just drawing a line it draws candles based on the calculation of the indicator. I have tried a hundred different ways to do it and had to admit defeat on how to make this work. Is there anybody that can do this or show me what line of code I need to use. Thank you so much, you guys really do such a good job with everything here.
This is the link to the original indicator
Cumulated Volume Velocity
Thanks for any help
Steve
What values do you want to use to use to create your candles as the indicator only returns two values, CumVolVel and avg? A candle has four values, open, high, low and close. We could draw a candle with no shadows using just the CumVolVel and avg and change the colour dependent on whether CumVolVel is higher or lower than the average like this:
p = 10
if(barindex>10) then
sRange = (high-low)
if(high<high[1] AND low<low[1]) then
CumVolVel = CumVolVel[1]-sRange*Volume
elsif(high>high[1] AND low>low[1]) then
CumVolVel = CumVolVel[1]+sRange*Volume
else
CumVolVel = CumVolVel[1]
endif
endif
avg = exponentialaverage[p](CumVolVel)
r = 128
g = 0
if CumVolVel > avg then
r = 0
g = 128
endif
DrawCandle(CumVolVel,avg,CumVolVel,avg) COLOURED(R,G,0) BORDERCOLOR(0,0,0)
RETURN
[attachment file=86596]
Thank you so much for your reply
Sorry it has taken me so a couple of days to respond to you, I somehow missed your reply. You have answered my question perfectly and that explains why I could not do it! I was trying to create a open, high, low close candle so that explains why I could not get it to work as I never considered this fact.
Once again thanks for the reply the community here is excellent and so helpful
Steve
I had seen the example of the RSI made with the draw candle function of the signal line with high low open close candles and had thought maybe it was possible signal line on this indicator.