-2

Image to clear what output is neededhad tried multiple logic to get exact bar number from opening of market where stock price was highest/lowest, Please suggest a better whole code.

e.g. attached image, where i want value 11 as output for day low bar via pine/tradingview script. it's today 23Jan23 chart for Nifty50 Index.

1 Answers1

0

About this:

suggest a better whole code

This is not a code writing service. I will give you a guide:

  1. To identify the first bar of the session use session.isfirstbar
  2. Count the bars using ta.barssince
  3. find the maximum value with math.max and minimum with math.min
Gu5tavo71
  • 706
  • 1
  • 4
  • 11