Uploaded April 2023 | Updated November 2026, 10 hours ago
🚩 My Socials & More Free Content: theartoftrading.com
🚩 FREE Pine Script Basics Course: courses.theartoftrading.com/courses/pine-script-basics-course
🚩 Pine Script Mastery Course: courses.theartoftrading.com/courses/pine-script-mastery
🚩 My Indicators & Strategies Course (Steal My Code!): courses.theartoftrading.com/courses/my-indicators
🔷 Create your FREE TradingView Account: tradingview.com/gopro/?offer_id=10&aff_id=15271
LESSON SOURCE CODE: courses.theartoftrading.com/pages/how-to-code-a-trailing-stop-loss-in-pine-script
----------------------------------------------------
Want to learn Pine Script? Look no further. I have you covered!
This lesson demonstrates various methods we can use to code trailing stop losses in Pine Script to lock in profits in strategy scripts - including ATR and Percentage-based variants with several parameters.
With over 16 years of coding experience and 5+ years of profitable 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.
MORE RESOURCES:
🔷 My Blog & Socials: theartoftrading.com
🔷 My Free Indicators: zenandtheartoftrading.com/indicators
🔷 My Favorite Trading Books: zenandtheartoftrading.com/top-10-best-trading-books
🔷 My Favorite Trading Psychology Books: zenandtheartoftrading.com/trading-psychology/10-best-trading-psychology-books-of-all-time
🔷 My Trading Video Library: zenandtheartoftrading.com/video-library
🎤 The Art of Trading Podcast: thetradingpodcast.com
If you want more information about who I am and what I do, head over to zenandtheartoftrading.com/about.
â–¼Timestampsâ–¼
00:00 - Intro & Overview
01:05 - Script Settings
05:35 - Preparing Trailing Stop Variables
08:20 - Calculating Trailing Stop Price
16:13 - Updating Trailing Stop Price & Alerts
23:23 - Exiting Based On Candle Closes
25:20 - Final Summary
#PineScript #TradingView #Trading
🚩 My Socials & More Free Content: theartoftrading.com
🚩 FREE Pine Script Basics Course: courses.theartoftrading.com/courses/pine-script-basics-course
🚩 Pine Script Mastery Course: courses.theartoftrading.com/courses/pine-script-mastery
🚩 My Indicators & Strategies Course (Steal My Code!): courses.theartoftrading.com/courses/my-indicators
🔷 Create your FREE TradingView Account: tradingview.com/gopro/?offer_id=10&aff_id=15271
LESSON SOURCE CODE: courses.theartoftrading.com/pages/how-to-code-a-trailing-stop-loss-in-pine-script
----------------------------------------------------
Want to learn Pine Script? Look no further. I have you covered!
This lesson demonstrates various methods we can use to code trailing stop losses in Pine Script to lock in profits in strategy scripts - including ATR and Percentage-based variants with several parameters.
With over 16 years of coding experience and 5+ years of profitable 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.
MORE RESOURCES:
🔷 My Blog & Socials: theartoftrading.com
🔷 My Free Indicators: zenandtheartoftrading.com/indicators
🔷 My Favorite Trading Books: zenandtheartoftrading.com/top-10-best-trading-books
🔷 My Favorite Trading Psychology Books: zenandtheartoftrading.com/trading-psychology/10-best-trading-psychology-books-of-all-time
🔷 My Trading Video Library: zenandtheartoftrading.com/video-library
🎤 The Art of Trading Podcast: thetradingpodcast.com
If you want more information about who I am and what I do, head over to zenandtheartoftrading.com/about.
â–¼Timestampsâ–¼
00:00 - Intro & Overview
01:05 - Script Settings
05:35 - Preparing Trailing Stop Variables
08:20 - Calculating Trailing Stop Price
16:13 - Updating Trailing Stop Price & Alerts
23:23 - Exiting Based On Candle Closes
25:20 - Final Summary
#PineScript #TradingView #Trading

![Pine Script [OUTDATED V4] Tutorial | Lesson 5 | TradingView Script Alerts
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
My Indicators: https://zenandtheartoftrading.com/indicators/
Pine Scripters Network (Forum): https://www.pinescripters.net
Note: I forgot to mention in this lesson that you can only use ONE alert function per script. So if your script generates multiple alert conditions, then you must include all of your alert booleans in the single line of code. For example:
alertcondition(isRsiOB or isRsiOS or someThirdCondition or someFourthCondition, title=Alert Title, message=Alert Message)
Want to learn how to code in Pine Script but unsure of where to even start? Fear not! I have you covered.
In this video lesson series Im going to teach you how to create your own scripts in TradingViews Pine Script programming language.
Todays lesson covers how to add alert functionality to your custom-built scripts or any scripts that you find on TradingView that do not contain alert functionality already.
Get ready to take your trading to the next level. Im excited to share my knowledge with the trading community to help you guys enhance your edge and become the best traders you can possibly be!
For more information visit my website where I have a series of text lessons as well as my collection of open-source TradingView indicators: https://zenandtheartoftrading.com/pinescript/
Lesson 5 Source Code: https://zenandtheartoftrading.com/pinescript/how-to-create-tradingview-alerts/
Pine Script Wiki: https://www.tradingview.com/pine-script-docs/en/v4/Introduction.html
My Other Indicators: https://zenandtheartoftrading.com/indicators/
Visit https://zenandtheartoftrading.com for more forex and trading psychology tips!
Join My Mailing List: https://mailchi.mp/f29afd740719/zenandtheartoftrading
Public Forex Trading Journal: https://zenandtheartoftrading.com/forex-journal/
Best Trading Books: https://zenandtheartoftrading.com/top-10-best-trading-books/
Best Trading Videos: https://zenandtheartoftrading.com/video-library/
Best Charting Platform: https://zenandtheartoftrading.com/tradingview-review/
Best Indicators For Forex: https://zenandtheartoftrading.com/blog/forex/3-best-forex-trading-indicators/
Music: https://soundcloud.com/mjslabosz
Disclaimer:
The content covered in this video is NOT investment advice and I am not a financial advisor. The material covered and the resources offered are for educational purposes only. Always do your own research and only execute trades based on your own personal judgment.
#PineScript #TradingView #Indicator Pine Script [OUTDATED V4] Tutorial | Lesson 5 | TradingView Script Alerts](https://i.ytimg.com/vi/BJr5JGDsMis/mqdefault.jpg)

![🤖 How to use AUTOVIEW to send trading commands to OANDA 🤖 AutoView Guide (PART 3/8) [PSv4]
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
AutoView: https://autoview.with.pink/
My Indicators: https://zenandtheartoftrading.com/indicators/
Create Your FREE TradingView Account: https://www.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 the various AutoView commands for interacting with the Oanda API.
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
01:00 - Commands Overview
03:30 - Market Orders
05:34 - Disable Parameter
06:50 - Delay Parameter
07:45 - Close Position
08:50 - SL/TP Pips
12:12 - SL/TP Price
15:50 - Guaranteed Stop Loss
17:40 - Limit Orders
20:30 - GTD Expiry (Date)
22:20 - GTT Expiry (Time)
26:00 - Break-Even Command
39:16 - Trailing Stop Command
44:42 - Reduce Only Parameter
46:52 - Account Alias Parameter
51:20 - More Resources
#PineScript #TradingView #AutoView 🤖 How to use AUTOVIEW to send trading commands to OANDA 🤖 AutoView Guide (PART 3/8) [PSv4]](https://i.ytimg.com/vi/BpOQSBUJFB4/mqdefault.jpg)
![How to AUTOMATE a Pine Script STRATEGY 🤖 AutoView Guide (PART 6/8) [PSv4]
+ 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
+ My Indicators & Strategies Course: https://courses.theartoftrading.com/courses/my-indicators
+ Source Code: https://www.tradingview.com/script/t776tkZv-Hammers-Stars-Strategy/?offer_id=10&aff_id=15271
+ Podcast: http://thetradingpodcast.com/
+ My Free Indicators: https://zenandtheartoftrading.com/indicators/
+ Create your FREE TradingView Account: https://www.tradingview.com/gopro/?offer_id=10&aff_id=15271
### RESOURCES FOR THIS VIDEO: ###
AutoView Mastery Playlist: https://www.youtube.com/watch?v=MZvgqJaaSNs&list=PLSP_1DBafH-EYd8t-DUrPaAhsoOD-vZ1D
Hammers & Stars Detection Lesson: https://www.youtube.com/watch?v=z3Sq6snvFQs
Position Size Calculation Lesson: https://www.youtube.com/watch?v=6l_RXZTKzXo&list=PLSP_1DBafH-EYd8t-DUrPaAhsoOD-vZ1D&index=4
AutoView Syntax Lesson: https://www.youtube.com/watch?v=TvhlQmjmBk0&list=PLSP_1DBafH-EYd8t-DUrPaAhsoOD-vZ1D&index=2
Backtesting Lesson: https://www.youtube.com/watch?v=W_EECZtRBE8
Want to learn Pine Script? Look no further. I have you covered!
This lesson demonstrates how to create a profitable TradingView Strategy Tester script, and then we add AutoView automation to that script through the use of alerts.
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
03:00 - User Input
08:25 - Detect Trading Setups
20:05 - Calculate Stops & Targets
25:55 - Strategy Entry Command
28:10 - Strategy Exit Command
31:08 - Draw Signals, Stops & Targets
34:50 - Calculate Oanda Position Size
39:04 - Formatting AutoView Alerts
43:27 - Summary & Outro
#PineScript #TradingView #AutoView How to AUTOMATE a Pine Script STRATEGY 🤖 AutoView Guide (PART 6/8) [PSv4]](https://i.ytimg.com/vi/BvbnzQwLmNQ/mqdefault.jpg)
![Alerts & TIME SESSIONS • 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#alertstime
My Indicators: https://zenandtheartoftrading.com/indicators/
Pine Scripters Network (Forum): https://www.pinescripters.net
This lesson comes from a question submitted by Jason over at The Chart Guys: https://www.chartguys.com
Want to learn Pine Script? Look no further. I have you covered.
This guide covers how to use time sessions to determine when (or when not) to trigger alerts.
With over 15 years of coding experience and 4+ years of trading experience, I now 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:52 - User Input
02:30 - Time Session Function
05:40 - Check Candle Time
07:30 - Change Bar Color
08:50 - Disable Alerts Within Session
10:30 - Enable Alerts Within Session
12:16 - Pine Script Mastery Course
#PineScript #TradingView #Trading Alerts & TIME SESSIONS • Pine Script [OUTDATED V4] Tutorial](https://i.ytimg.com/vi/CL2mXazJqWU/mqdefault.jpg)




