'How to change bar index from pinescript to python?

I'm just building something using python from an indicator I made and I'm stuck.

Part of the code looks like this:

study(...)
...
n=bar_index
...
plot(...)

The question I have which I've been asking around is how do I convert n =bar_index into something from pinescript to something which will work in python?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source