Green Bars

A simple script to count the number of up days, or intraday bars, (Green Bars) for a given Look Back period.

Inputs are: Look Back Period and Increment.

Use 0 for the Increment to count only the up days, or bars.
Use -1 to include the down days, or bars, in the sum.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.


The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?