Perhaps you mean that if the green bar is bigger than the red bar then the red bar is hidden. If so this version fixes that issue by changing the order they are drawn in.
//o=open
hi=high
l=low
c=close
v=volume
buying=v*(c-l)/(hi-l)
selling=v*(hi-c)/(hi-l)
if buying > selling then
a = buying
ra = 0
ga = 255
b = selling
rb = 255
gb = 0
else
a = selling
ra = 255
ga = 0
b = buying
rb = 0
gb = 255
endif
return a coloured(ra,ga,0) style(histogram,2) ,b coloured(rb,gb,0) style(histogram,1)
In any event, the summation [14] used with a moving average is useful.
If you have improvements then please post the code here so others can use and analyse?
@Vonasi – this is what i meant and thanks for posting the corrected code, the volume bars are distinguishable at a glance now- perfect!
this version fixes
Yep … thanks Vonasi, green now showing on previously ‘all red’ bars … see attached lower histo compared to histo above.
variables 14 and 72 or whatever floats your boat
//o=open
hi=high
l=low
c=close
v=volume
buying=v*(c-l)/(hi-l)
selling=v*(hi-c)/(hi-l)
sv=selling
bv=buying
//x
//y
return bv ,sv , summation[x](bv-sv),summation[y](bv-sv),summation[x](sv),summation[x](bv)
Sry @GraHal figured you would be able to do that…..for some reason I am unable to post images else I would have.
I am unable to post images
What size are your images … max file size is 2MB?
Are you posting .jpg or .png … that’s what I post no problem.
I have tried every which way but ….. and to no avail.
so can you attach an image to a post, but it will not send?
OR
You can’t attach an image to a post?
I think the former Graham
Assuming file size is < 2MB then maybe it is your anti-virus or some setting on your browser?
Have you tried on other browsers?
Yes chrome and ffox , I think is more likely that my computer is rather old i.e wxp.
To the hierarchy
Do you think it would be possible to transfer the colouring to a candle/bar chart? I think it might be above my paygrade.?
R