Support And Resistance Lines

Dhenmas210

Trader
Dec 30, 2021
5
3
9
33
Bogor
hello.
I am a beginner who is just learning to make an indicator, I managed to make an indicator to draw support and resistance lines. maybe someone can help me to edit how to use enum to easily choose between 3 lines.
thank you
and there may be errors in writing, because I only learn from reading existing indicators
I actually want to add a feature, if the price crosses the line a notification appears, but it seems it still takes quite a long time for me to understand.
0.png
 

Attachments

  • Care_Lines.mq4
    8.7 KB · Views: 13

Enivid

Administrator
Staff member
Nov 30, 2008
18,613
1,366
144
Odesa
www.earnforex.com
If you want to use an enum, you just declare it above the inputs code like this:
MQL4:
enum ENUM_SR_TYPE
{
    Pivot,
    Camarilla,
    Fibonacci,
    Classic
};

Then you declare the input of this enum type:
MQL4:
input ENUM_SR_TYPE SupportAndResistanceType = Pivot;

Then you use it in the code in if-statements. For example:
MQL4:
if (SupportAndResistanceType == Pivot)
{
    //...
}