I want my Indicator to be shown in 5 min only in pine script?

Viewed 37

I want my Indicator to be shown in 5 min timeframe only in pine script ?

How to do it?

1 Answers

Find out if it is the 5 min timeframe like so:

is_five_min = (timeframe.isminutes) and (timeframe.multiplier == 5)

Then put your whole code in an if check like:

if (is_five_min)
    // Do stuff

Note: Not all functions can work in a local scope so you might need to do something like this:

plot(is_five_min ? close : na)
Related