I want to open trade only between 10h and 15h but nothing seem to work?
I tried to put this on my if condition for strategy.entry
TimeWindow=time(timeframe.period,"1000-1500", "GMT")
I received this message
The
expr1
parameter of theoperator and
function accepts a 'bool' argument. To avoid potential unexpected results, pass a 'bool' value or expression to this parameter.TimeWindow (user-defined variable)
type series int
Here we go:
Allowedhours = input.session(defval="1000-1500", title="Allowed hours")
inSession = not na(time(timeframe.period, Allowedhours))
if barstate.isconfirmed and enterLong and inSession
strategy.entry('L', strategy.long, alert_message= message_long )