In this tutorial, we will show you how to create a PaintBar indicator with EasyLanguage.
This type of indicator is very useful, and at the same time, the procedure to create it is very simple.
As you will know, in our examples and tutorials we often use the RSI indicator. So also, in this case, we will create a PaintBar indicator based on the relative strength index.
First of all, in the TradeStation EasyLanguage Editor Choose New – PaintBar
How PaintBar Algorithm works
To better understand how the algorithm that creates the PaintBars works, we will try to make a small change to the code.
We will increase the high by 0.05% and reduce the low by 0.05%.
As you can see the algorithm modifies not only the color but also the body of the candle.
Example of EasyLanguage Code:
High_PB = High + (High*0.05);
Low_PB = Low – (Low*0.05);
Finally, we can use this PaintBar EasyLanguage indicator to draw an area in the chart.
Variables: Top(0), Bottom(0); Top = BollingerBand(Close, 14, 2); Bottom = BollingerBand(Close, 14, -2); If ADX(14) < 25 Then PlotPaintBar(Top, Bottom, "Area", Blue);