Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How pivothigh() and pivotlow() function work on Tradingview Pinescript?

I'm trying to rewrite a script to Python, but I can't figure out how pivothigh() and pivotlow() function work, and I can't find source code, I know how to calculate Pivot Points, but what leftbars and rightbars means in this two function? Please help.

like image 958
Inso Avatar asked Dec 23 '22 16:12

Inso


1 Answers

Leftbars and rightbars are number of bars that the pivot functions looks when is searching for a pivot. For example: pivothigh(10,10) will search for high price that was not exceeded during 10 bars to the left (past data) and 10 bars to the right (future data). Note that the function won't be able to determine the pivot if there is less than 10 bars to the right.

like image 170
e2e4 Avatar answered May 17 '23 09:05

e2e4