Goodmorning, working with tick candles, I would like to ask if is possible to have an indicator that counts the number of the candles created every defined period of time (1 minute for example) and if is possible also how many are green and how many are red. Thanks and best regards, Ivan
Hi,
To be added as a window below price, for all candles within 1 minute, with red as “negative histogram” in order to be more distinct from green count:
if OpenMinute<>OpenMinute[1] or OpenHour<>OpenHour[1] then
total=0
red=0
green=0
flat=0
endif
if open>close then
red=red+1
elsif open<close then
green=green+1
elsif open=close then
flat=flat+1
endif
total=total+1
return total as "Total", -red coloured(255,0,0) style(histogram) as "Red", green coloured(0,150,0) style(histogram) as "Green", flat as "open=close"
Hello,
Could you do the same code but instead of making it 10 minutes?
Thank you.
Hello,
Adapting the code to count on (x) ticks timeframes red and green candles for intervals of 10 minutes instead of 1:
same10= floor(openminute/10)
if same10<>same10[1] or OpenHour<>OpenHour[1] then // the openhour part is not unnecessary between same10=5 and same10=0 , it is there in case of ovn with 2 consecutive candles of same same10 minute category but for 2 different hours
total=0
red=0
green=0
flat=0
endif
if open>close then
red=red+1
elsif open<close then
green=green+1
elsif open=close then
flat=flat+1
endif
total=total+1
return total as "Total", -red coloured(255,0,0) style(histogram) as "Red", green coloured(0,150,0) style(histogram) as "Green", flat as "open=close"
Hello,
It seemed like an incredible solution to me. I’ve tried it and it works perfectly.
Thank you so much.