Welcome to the BEST forum for traders

Did you know we're sharing tons of exclusive content here?
Our community is growing quickly. Take a look around and say "Hello".

  • Forums
  • Pinescript
  • How to evaluate the highest value of the displayed range of an indicator?

How to evaluate the highest value of the displayed range of an indicator?

Aug 8, 2021 - 8:27 AM

Viewed 388 times

https://best-trading-indicator.com/community/bti/forums/4180/topics/25443 COPY
  • I'm writing a pine code and need to evaluate the highest and lowest value of an indictor (like rsi) displayed on the window (shown time range), and if I change the time range it can be updated automatically (like high, avg, low label of price bar that trading view has), anyone knows how can I evaluate the highest value of the displayed range of an indicator?

    or how can we get the bar_index of the first and last bar displayed on the tradingview chart?

    Thanks

    0
  • Hello there

    To the first question, use this
    https://www.tradingview.com/pine-script-reference/v4/#fun_highest

    To the second question, bar_index of the first is bar is always 0 and bar_index of the last bar is always 20000 is your a Premium user, otherwise it's 10000

    0
CONTENTS