Skip to main content

Different Categories of Nodes

Each node represents a block of code or functionality in Pine Script. They are categorized into the following types:

  • Input, Indicator, Util, Condition, Drawing, and Signal Nodes.

Input Nodes

Input nodes allow you to edit a property or value within the TradingView platform. For instance, in the image below, we have an Input node for a Whole Number.

YourTradingBuddy - input nodes in script builder

When you paste the generated script into TradingView, the script will include a Length setting with a default value of 10. This can be edited by the user, enabling you to adjust the length of the SMA indicator without regenerating new Pine Script code.

YourTradingBuddy - input nodes in TradingView

Indicator Nodes

Indicator nodes are blocks of code that convert into trading indicators. Examples include:

  • EMA
  • SMA
  • MACD

Using these nodes will instantly generate a TradingView script for that indicator. This is especially useful for traders who often create strategies based on trading indicators developed by previous traders and mathematicians.

Support

We are continuously updating this indicator library to provide you with the best and latest indicators in the trading world.

Util Nodes

Utility nodes solve common problems encountered while building trading scripts.

For example, to retrieve the previous value of the EMA, you can use the Previous Bar utility. It features two properties: Source and Lookback Period. By setting the EMA value as the source property of the Previous Bar node, the output will be the previous value of the EMA indicator, given that the lookback period is set to 1.

YourTradingBuddy - Previous Bar Node

Condition Nodes

When you need to compare values of different indicators, you can use Condition Nodes. These nodes compare two values and return results based on the comparison. Some examples include:

  • Greater than
  • Less than
  • And so on...

For instance, using the Cross Over Condition Node, you can determine if a candle crossed over the EMA 50. Connect the Candle value to the A target handle and the EMA value to the B handle. The node will return true if A crosses over B, and false otherwise.

YourTradingBuddy - Cross over condition node

Condition nodes can output various values beyond just true/false. You can also output custom values.

YourTradingBuddy - Output of condition nodes

This is useful for customizing indicator colors. For example, you can use Green when the candle is above the EMA and Red otherwise.

YourTradingBuddy - changing color by using condition nodes

Drawing Nodes

Drawing nodes are used to draw lines or labels on the chart, providing a visual representation of values and indicators. Commonly used nodes include Line and Label. When using these nodes, you need to pass a value to the Source property.

YourTradingBuddy - drawing node source property

In the Line node, you need to pass a Decimal Number value (highlighted in red) to the target handle to draw a line on the chart.

YourTradingBuddy - buy and sell strategy with tradingview strategy tester

Signal Nodes

Signal nodes are primarily used for creating Trading Strategies. In your Script Properties, you can change the script type to Strategy.

YourTradingBuddy - script properties for strategy

Then, you can use buy and sell nodes to backtest your trading strategy using TradingView's Strategy Tester.

YourTradingBuddy - buy and sell signal for strategy scripts

YourTradingBuddy - buy and sell signal on tradingview strategy tester

Summary

In this lesson, you learned about the different categories of nodes and their functionalities. Understanding these categories will help you quickly find the appropriate nodes in our library when building your trading script.