I need a sleep/pause function. I use a trading bot and I want to not take a trade between 23:00 and 00:00 clock.
I'm not good at coding, so if anybody can help me I'm gonna be very thankful.
The time
function has a session
parameter you can use. If used, this function will return the UNIX time if the bar is inside the session and NaN if the time point is out of session.
Since you are looking for all the times besides 11:00-12:00, you can set this times as the session and check when the function return NaN:
session = input("1100-1200")
notInSession = na(time(timeframe.period, session))
long = notInSession and yourCondition