EasyLanguage Tutorial - How to (Auto) Add Text with Custom Indicator
Do you want to know how to add text on the chart with EasyLanguage automatically? This EasyLanguage tutorial is made for you! Follow step by step what we will show you and you will be able to create a beautiful indicator that will automatically insert the text on your graphics.
To do this we will use the reserved word in easylanguage "Test_New".
The indicator will follow the trend of a 14-period RSI and will signal the OverBought and OverSold areas.
Insert the Lenght for the RSI calculation - 14 is the standard value
The RSI_Value contains the RSI calculations
This is the calculation formula for the RSI - 14 periods
The condition is simple; when RSI is under 30 the indicator adds the text
Value1 is the variable that contains the text
Text_New is the EasyLanguage Reserved Word:
Value1 = Text_New(BarDate, BarTime, Price, "MyText")
In this example we're using:
BarDate = Date -- Actual date
BarTime = Time -- Actual time
Price = Low -- Add text at Low Price for oversold and at High Price for OverBought
With the Reserved Word Text_SetColor you could choose the color.
Text_SetStyle(Text_ID, Horiz, Vert)
With the Reserved Word Text_SetStyle you could choose the horizontal and vertical placement settings for the text object.
0 = To the right of the bar
1 = To the left of the bar
2 = To the center of the bar
0 = Beneath the price
1 = Above the price
2 = Centered on the price
How to avoid unnecessary text repetitions
The RSI indicator can remain overbought or oversold for numerous bars. The indicator will then add the text in each bar, creating a useless repetition.
To avoid this problem we will have to create an additional filter. For example, we will add the text only when the RSI changes from normal to oversold or overbought.
Start To Learn EasyLanguage Today !!
We offer individual coaching program
First session is free
Your Information is safe with us. We respect your privacy! We will never share your data with anyone else.