A Simple Moving Average Cross Strategy (& how to use valuewhen)

Published: 03 February 2023
on channel: The Art of Trading
13,912
460

🚩 My Socials & More Free Content: https://theartoftrading.com
🚩 FREE Pine Script Basics Course: https://courses.theartoftrading.com/c...
🚩 Pine Script Mastery Course: https://courses.theartoftrading.com/c...
🚩 My Indicators & Strategies Course (Steal My Code!): https://courses.theartoftrading.com/c...

🔷 Create your FREE TradingView Account: https://www.tradingview.com/gopro/?of...

LESSON SOURCE CODE: https://courses.theartoftrading.com/p...
----------------------------------------------------

Want to learn Pine Script? Look no further. I have you covered!

This lesson answers a question from a student who wants to get the closing price of a confirmed MA cross. In this video I demonstrate how to do that, and also how to use the valuewhen function. I also turned the script into a strategy, because why not?

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: https://www.theartoftrading.com
🔷 My Free Indicators: https://zenandtheartoftrading.com/ind...
🔷 My Favorite Trading Books: https://zenandtheartoftrading.com/top...
🔷 My Favorite Trading Psychology Books: https://zenandtheartoftrading.com/tra...
🔷 My Trading Video Library: https://zenandtheartoftrading.com/vid...

🎤 The Art of Trading Podcast: http://thetradingpodcast.com/

If you want more information about who I am and what I do, head over to https://zenandtheartoftrading.com/about.

▼Timestamps▼
00:00 - Intro & Question
02:00 - Detecting Moving Average Crosses
03:33 - Getting & Displaying the MA Cross Price
07:00 - How to Use ta.valuewhen()
08:40 - Detecting the Highest/Lowest Close After A Cross
12:45 - Converting This Indicator Into A Strategy
17:47 - Completely Free Weekly Newsletter!

#PineScript #TradingView #Trading