Hello dear Community,
I would like to specify in my code that results are only displayed if the current candle is already at least 50% complete.
Can anyone help me?
Thanks!
If you mean 50% size… nobody knows what 100% will be.
If you mean 50% time (say after 15 minutes on a 30-minute TF), you can try using TIME, but I never tried and cannot test it now.
TIME does not work. I wrote this code to be applied to a 5-minute chart (to check a 10-minute chart), but it doesn’t return any result:
TIMEFRAME(10 minute)
myRSI = RSI[14](close)
Flag = myRSI > 0
TIMEFRAME(5 minute)
MyTime = ((OpenMinute mod 5) = 0) AND ((OpenMinute mod 10) <> 0)
TIMEFRAME(default)
SCREENER[Flag > 0 AND MyTime = 1] (OpenMinute AS "Time")
Hi, Roberto,
Thank you for your answer.
Yes that was related to the >50% time.
I didn’t manage it either, maybe Nicolas can help us?
I’m testing this code:
once NbBar = 1
MyDay=day
dayminutes = 1440*(MyDay-MyDay[1])
MyHour=hour
hourminutes = 60*(MyHour-MyHour[1])
MyMin=minute
barminutes = MyMin - MyMin[1] + hourminutes + dayminutes
barminutes=abs(barminutes)
Mybarminutes = lowest[NbBar](barminutes)[1]
q = minute/mybarminutes
test = round(q)-q<.5 and round(q)-q>0
screener[test](minute/mybarminutes)