Uploaded January 2021 | Updated November 2026, 3 hours ago
Pine Script Mastery Course: courses.theartoftrading.com/courses/pine-script-mastery
FREE Pine Script Basics Course: courses.theartoftrading.com/courses/pine-script-basics-course
Source Code: courses.theartoftrading.com/pages/pine-script-mastery-source-code#forloops
My Indicators: zenandtheartoftrading.com/indicators
Create Your FREE TradingView Account: tradingview.com/gopro/?offer_id=10&aff_id=15271
Want to learn Pine Script? Look no further. I have you covered!
This lesson demonstrates how to use For Loops in your scripts. Today we're using a For Loop to count the past X amount of positive bars, then converting that number into a percentage in order to create a Positive Bars Oscillator.
With over 15 years of coding experience and 4+ years of trading experience, I specialize in TradingView's Pine Script programming language and I'm here to pass on everything I've learned about both trading and coding.
If you want more information about who I am and what I do, head over to zenandtheartoftrading.com/about.
▼Timestamps▼
00:00 - Intro
01:16 - Setting Up The Script
02:20 - Getting User Input
03:17 - Using For Loops
05:51 - Counting Bullish Bars
07:23 - For Loop Operators
09:20 - Getting Positive Bars %
09:50 - Plotting Data to Chart
13:46 - Adding Alert Functionality
18:40 - Recap
20:10 - Pine Script Courses
#PineScript #TradingView #Indicator
Pine Script Mastery Course: courses.theartoftrading.com/courses/pine-script-mastery
FREE Pine Script Basics Course: courses.theartoftrading.com/courses/pine-script-basics-course
Source Code: courses.theartoftrading.com/pages/pine-script-mastery-source-code#forloops
My Indicators: zenandtheartoftrading.com/indicators
Create Your FREE TradingView Account: tradingview.com/gopro/?offer_id=10&aff_id=15271
Want to learn Pine Script? Look no further. I have you covered!
This lesson demonstrates how to use For Loops in your scripts. Today we're using a For Loop to count the past X amount of positive bars, then converting that number into a percentage in order to create a Positive Bars Oscillator.
With over 15 years of coding experience and 4+ years of trading experience, I specialize in TradingView's Pine Script programming language and I'm here to pass on everything I've learned about both trading and coding.
If you want more information about who I am and what I do, head over to zenandtheartoftrading.com/about.
▼Timestamps▼
00:00 - Intro
01:16 - Setting Up The Script
02:20 - Getting User Input
03:17 - Using For Loops
05:51 - Counting Bullish Bars
07:23 - For Loop Operators
09:20 - Getting Positive Bars %
09:50 - Plotting Data to Chart
13:46 - Adding Alert Functionality
18:40 - Recap
20:10 - Pine Script Courses
#PineScript #TradingView #Indicator



![Detecting HAMMERS & SHOOTING STARS • Pine Script [OUTDATED V4] Tutorial
Pine Script Mastery Course: https://courses.theartoftrading.com/courses/pine-script-mastery
FREE Pine Script Basics Course: https://courses.theartoftrading.com/courses/pine-script-basics-course
Source Code: https://courses.theartoftrading.com/pages/pine-script-mastery-source-code#hammerstars
My Indicators: https://zenandtheartoftrading.com/indicators/
Want to learn Pine Script? Look no further. I have you covered!
This lesson demonstrates how to detect hammer & shooting star candles.
With over 15 years of coding experience and 4+ years of trading experience, I specialize in TradingViews Pine Script programming language and Im here to pass on everything Ive learned about both trading and coding.
If you want more information about who I am and what I do, head over to https://zenandtheartoftrading.com/about.
▼Timestamps▼
00:00 - Intro
00:56 - The Theory
02:24 - Get User Input
03:30 - Calculating Fibonacci Levels
04:33 - Getting Price Source
05:42 - Detecting Hammers & Shooting Stars
06:32 - Drawing Signals
07:09 - Adding Alerts
07:56 - Color Filter
09:58 - Pine Script Mastery Course
#PineScript #TradingView #Indicator Detecting HAMMERS & SHOOTING STARS • Pine Script [OUTDATED V4] Tutorial](https://i.ytimg.com/vi/z3Sq6snvFQs/mqdefault.jpg)

