Create Your First Indicator

Get Started
 

Create Your First Indicator


 
Now, let's create an indicator that displays the EMA and Supertrend indicators on the main chart. This indicator will also show their respective buy and sell signals, along with corresponding alerts.
 

Create an Indicator

Open the Pineify Builder and click the "Create" button on the homepage. In the pop-up dialog box, choose the type of indicator you want to create. Then, select the corresponding blank template from the options provided.
 
notion image
 
notion image
 
An empty indicator has now been created. Let's proceed step by step to build this indicator 🥳.
 

Add input

 
On the editor page, you'll find Input Elements on the right side. There are 13 different input types available, as illustrated below.
 
notion image
 
Inputs allow indicators to accept user-modifiable values that can be adjusted in the indicator settings. This feature makes it much easier to change parameters for your indicators in TradingView without editing any code.
 
Let's create two Number-type inputs for Slow EMA Length and Fast EMA Length, and one Decimal-type input for the Supertrend Factor. You can see the setup in the screen below.
  • Slow EMA Length
    • notion image
  • Fast EMA Length
    • notion image
  • Supertrend Factor
    • notion image
 
You can create the input here, or when creating the indicator, select "Use Input" to quickly create it.
Note: The key difference between Number and Decimal inputs is that Number accepts only integers, while Decimal allows both integers and decimal fractions.
 
After completing the setup, you'll see these three inputs in your Inputs panel.
notion image
 

Add Indicator

For our indicator, we'll create three components: a Slow EMA, a Fast EMA, and a Supertrend.
In the dialog box, simply enter the indicator names and link the parameters to the corresponding Inputs we've just created. Then, choose the plot style in the Plots section, where you can adjust features like the color and width of the line.
  • Slow EMA
    • For the Length parameter, we can use either a fixed value or an Input. To make it easier to adjust the value in TradingView settings, we'll enable "Use Input" and select the "Slow EMA Length" we just created.
      notion image
  • Fast EMA
    • Similar to the Slow EMA, we'll select the "Fast EMA Length" as the parameter. We'll also set a different color for the line to distinguish it on the chart.
  • Supertrend
    • Search for and add the Supertrend indicator. Use the "Supertrend Factor" Input as the parameter for the Factor. Keep the default plot properties.
 
After completing the setup, you'll see these three indicators added to your Indicators panel.
notion image
 
Now, click the "Copy Pine Script" button in the top right corner. Then, create a new indicator in TradingView and paste the copied code. You'll see the default plots of these three indicators appear on the main chart.
notion image
 
If you find the chart too cluttered, consider setting the Supertrend line to transparent while retaining only its background color.
 

Add Condition

A condition evaluates whether an indicator's output, a specific circumstance, or other candle-based values meet a certain criteria—such as exceeding or falling below a particular threshold. It yields a true or false result at the conclusion of each candle.
 
Now, let's create two conditions: EMA Buy Signal and EMA Sell Signal.
  • EMA Buy Signal: This condition is met when the Fast EMA crosses above the Slow EMA.
  • EMA Sell Signal: This condition is met when the Fast EMA crosses below the Slow EMA.
 
Next, click on "Condition" in the right panel to create a new condition. In the Condition Editor, set up the conditions as follows:
  • EMA Buy Signal
    • notion image
  • EMA Sell Signal
    • notion image
 
After setting up these conditions, you'll find them added to your Conditions panel.
notion image
 
Now, let's visualize the buy and sell signals on the chart.
 

Add Plot

All chart visualizations can be accomplished through Plots. In this section, we'll mark four signals on the chart: EMA Buy Signal, EMA Sell Signal, Supertrend Buy Signal, and Supertrend Sell Signal.
We'll use character plots to display symbols on the chart. For buy signals, we'll use a green â–², and for sell signals, a red â–¼. These character plots effectively visualize trading signals.
  • EMA Buy Signal Plot
    • The Location property determines where the indicator will be plotted on the chart. In this case, we'll consistently place buy signals below the price bar and sell signals above it.
    • The Data property specifies the condition for plotting. The selected value is converted to true or false. A true value results in the plot being drawn on that bar, while a false value means no plot will appear.
    • The Text property specifies the displayed text. Here, we'll use the indicator names to distinguish between buy and sell signals from each indicator.
    • notion image
  • EMA Sell Signal Plot
    • notion image
  • Supertrend Buy Signal Plot
    • notion image
  • Supertrend Sell Signal Plot
    • notion image
 
After completing the setup, these four plots will appear in our Plots panel.
notion image
 
Now, the buy and sell signal points are clearly visible on the main chart.
notion image
 
Let's now add alerts for buy and sell signals. This will enable us to receive real-time notifications via email and mobile apps.
 

Add Alert

We will now create four alerts: EMA Buy Alert, EMA Sell Alert, Supertrend Buy Alert, and Supertrend Sell Alert. For each alert, we need to select the corresponding conditions and specify the alert message content.
For alert messages, you can search for predefined messages in the search box and incorporate placeholders into your custom messages.
Let's look at the configuration of the EMA Buy Alert as an example:
 
notion image
 
After completing the setup, you'll see these four alerts added to your Alerts panel.
notion image
 
We have now successfully created an indicator that displays both the EMA and Supertrend indicators on the main chart. This indicator also showcases their respective buy and sell signals, complete with corresponding alerts.
Next, paste the latest code into TradingView and take the final step: configure the alert in TradingView.
 

Add Alerts on TradingView

Click the "Create Alert" button in the TradingView toolbar. Then, select the indicator you just created and choose "Any alert() function call" for the alert condition, as shown in the figure below.
notion image
 
After creating the alert, you can view active alerts and their corresponding logs in the Alerts panel on the right side of the TradingView interface.
notion image
 
Now, you can receive real-time notifications via email and mobile apps when the conditions are met.
🥳 Congratulations! You've successfully created your first indicator. You can now build more complex indicators by combining multiple indicators and conditions.
Pineify's capabilities extend far beyond what we've explored here. We're excited to see how you'll use it to build your own unique trading indicators!
 
In this guide, we've shown you how to create a customizable trading indicator using Pineify. By combining EMA and Supertrend indicators with buy/sell signals and alerts, you can enhance your trading strategy. Pineify's interface makes it easy to build indicators without complex coding, allowing you to focus on trading insights. With adjustable parameters, signal visualization, and notifications, you now have a powerful tool for market analysis. Pineify's versatility enables you to create sophisticated, personalized indicators. Ready to elevate your trading? Start with Pineify today!
Â