0

With Pine code, How do i test to see if the current chart time frame is between 4Hrs and 11Hrs or if the time frame is between 12Hrs and 4days?

What i tried:

IsHourlyTF2() =>
    timeframe.isminutes and (timeframe.multiplier >= 240 or timeframe.multiplier < 660)

IsDailyTF() =>
    timeframe.isminutes and (timeframe.multiplier >= 720 or timeframe.multiplier < 5760)
dawid
  • 3
  • 3

1 Answers1

0

You can do this by using the timeframe.in_seconds() variable. These will return true or false depending on if the chart time frame falls between 4 and 11 hours or 12 hours and 4 day.

tf411 = timeframe.in_seconds() >= timeframe.in_seconds('240') and timeframe.in_seconds() <= timeframe.in_seconds('660')
tf124 = timeframe.in_seconds() >= timeframe.in_seconds('720') and timeframe.in_seconds() <= timeframe.in_seconds('5760')
smashapalooza
  • 932
  • 2
  • 2
  • 12