TradingView introduces two new Pine Script functions
TradingView has added two new Pine Script functions, request.security_lower_tf() and request.economic(), and improvements to the existing request.security() function which allow traders’ scripts to access more data.
The new request.security_lower_tf() function makes it easier to request data from a lower timeframe than the charts. Before this new function, accessing all the 1min intrabars composing a 60min chart bar required complex user-defined functions and request.security() calls. The new request.security_lower_tf() now makes it a doddle by returning an array containing one value of the supplied expression for each intrabar. Note that the number of intrabars may vary for each chart bar.
The request.economic() function fetches economic data for a country or a region. Economic data includes information such as the state of a country’s economy (GDP, inflation rate, etc.) or of a particular industry (steel production, ICU beds, etc.)
request.security() can now return arrays, strings, booleans, colors, and tuples of these types.
Earlier this year, TradingView introduced a new Pine-based built-in indicator which traders requested – Auto Pitchfork.
This indicator is based on TradingView’s Pitchfork drawing tool, which takes points traders set then connects them together and creates a channel with several different Fibonacci levels inside of it. The new indicator helps automate this process: instead of requiring traders to specify points by hand, it searches for last notable pivot points and draws the pitchfork based on them. As a result, the pitchfork can be shown on any desired symbol automatically.