Matthew from The Art of Trading introduces a feature on TradingView’s Pine Script that allows connection to multiple external inputs. This new feature uncovers endless possibilities like utilizing values from closed source indicators. He gives an example by connecting his script to his dynamic structure indicator to add alert functionality. Furthermore, Matthew demonstrates how to reference values in a closed source script through the feature.
Unlocking New Capabilities with Pine Script’s External Input Feature
Introduction
Welcome back to the Art of Trading channel! In this video, we will be discussing the latest Pine script update released by the Trading View team. The update provides traders with a brand new feature that unlocks a whole range of new capabilities. We will be exploring how the newly introduced external input functionality allows traders to reference specific values from other indicators, even those that are closed source. This update also allows traders to add alert functionality to scripts that do not have it.
Apologies and a Teaser
Before we delve into the Pine script update, I would like to apologize for the delay in uploading new videos. I have been busy with family matters, but I am now back to work and excited to teach you all new skills. I would also like to tease next week’s video, where I will be breaking down the script on my chart, which is a monthly performance table. The table breaks down my strategy test data on a month-by-month and year-by-year basis. I will explain all of the numbers in next week’s video, including our compounded annual growth rate, max drawdown for the entire system on a realized equity basis, alongside other performance metrics.
Connecting Scripts to More External Inputs
Trading View’s latest update has added a new feature that supports multiple external inputs. This feature replaces the previous limit of only one external input. This new functionality allows traders to link outside sources to specific values in their Pine scripts, which can even originate from different indicators. Scripts can reference any value from an indicator, including Price Action indicators, closed source indicators, and even ones on other time frames.
Example Use Case: External Inputs from Session Volume Profile
Trading View’s external input feature allows traders to include a variety of external inputs beyond the typical Price Action indicators. As an example, let’s consider using a session volume profile as an external input for our script. If we apply a session volume profile to a chart and select five-minute intervals, we can come up to the settings menu of our strategy script and change our sources to the session volume profile, developing high, and developing low.
Adding Alert Functionality to Scripts That Don’t Have It
The external inputs feature also enables traders to add alert functionality to scripts that do not have any. For this example, we’ll use the Dynamic Structure Indicator, which detects support and resistance zones based on swing highs and lows. However, this script does not have any alert functionality built-in. You can solve this problem by introducing an external input to your script. To do this, copy and paste your script’s source code into a new script and remove all alert conditions. Since Trading View’s external inputs can reference any indicator value, including those from closed-source indicators, you can add custom conditions to detect when a signal appears on an external indicator. In this example, we added a Boolean value to detect when the current bar falls between two red lines and the closing price falls below the bottom line. This condition detects a rejection from resistance zones and generates an alert.
Conclusion
Trading View’s external input feature is a powerful tool that can be used to expand the possibilities of Pine scripts. Traders can reference external values from a variety of indicators such as Price Action indicators, closed-source indicators, and even those from other indicators on different time frames. Moreover, this feature enables traders to add alert functionality to scripts that do not have it by introducing custom conditions that detect signals on external indicators. Trading View’s updates always make trading more accessible and effective for its users, and this is no exception.