Hello!
I am trying to figure out how to return the amount of minutes passed from open – but i just cant get a hold of it.
The aim of this code is to retrieve the average minutes passed of each candle when using Tick Charts (just to get q quick hum about timeframe).
Does anyone have a suggestion? This is what ive come up with so far and it gives an OK estimate of average minutes, but would be more precise if i could get the (exact) amount of minutes passed since open.
defparam drawonlastbaronly=true
newday=intradaybarindex<intradaybarindex[1]
if newday then
drawvline(barindex)coloured(200,200,200,50)
opentid=openhour
else
drawtext("#opentid#",barindex,0.8)coloured(0,200,0)
closetid=openhour+1
drawtext("#closetid#",barindex,0.6)coloured(200,0,0)
tid=closetid-opentid
drawtext("#tid#",barindex,0.4)coloured(0,0,0)
drawtext("-",barindex,0)
tidminuter=tid*60
drawtext("#tidminuter#",barindex,-0.2)coloured(0,0,0)
idbx=intradaybarindex
drawtext("#idbx#",barindex,-0.4)
minpertick=(tidminuter/idbx)
drawtext("#minpertick#",barindex,-0.6)coloured(0,0,0)
endif
return
The “minpertick” is the number im aiming for.
Please note that the y-values have no purpose whatsoever – its just for me to see the “equation”.
THANKS!