Setting the indicator level programtically

 

Hi,

From what I see in  https://www.mql5.com/en/forum/448388 it is not possible to set

visualization properties of indicators programmatically, specifically

#property indicator_level1     30.0
#property indicator_level2     70.0

for iRsi, or Rsi either with iCustom or iRse as they are not parameters.

As I need to backtest in different RSI levels (20-80) or 30-70 and see those levels on an

indicator window chart (on the backtester historically and real time) I wonder how

to solve this issue.

Would it be possible creating an input variable inside the indicator source code that later

updates internally such property or any hack around it?


Thanks for any input

Can indicator visualization properties be set programatically?
Can indicator visualization properties be set programatically?
  • 2023.06.03
  • www.mql5.com
Hi Everyone I need an indicator to be displayed only on specified timeframe. Currently I have to do it manually by setting visualization property...
 
cmarconetti:

Hi,

From what I see in  https://www.mql5.com/en/forum/448388 it is not possible to set

visualization properties of indicators programmatically, specifically

#property indicator_level1     30.0
#property indicator_level2     70.0

for iRsi, or Rsi either with iCustom or iRse as they are not parameters.

As I need to backtest in different RSI levels (20-80) or 30-70 and see those levels on an

indicator window chart (on the backtester historically and real time) I wonder how

to solve this issue.

Would it be possible creating an input variable inside the indicator source code that later

updates internally such property or any hack around it?


Thanks for any input

The topic you are referring to has nothing to do with your issue, and indicator levels.

The standard RSI provided with MT5is hardcoded and can't be changed, but you can easily using a custom one (also provided with the platform) and modify it as you want.

 
Alain Verleyen #:

The topic you are referring to has nothing to do with your issue, and indicator levels.

The standard RSI provided with MT5is hardcoded and can't be changed, but you can easily using a custom one (also provided with the platform) and modify it as you want.

IndicatorSetDouble(INDICATOR_LEVELVALUE,0,Inp_RSI_Level1);
   IndicatorSetDouble(INDICATOR_LEVELVALUE,1,Inp_RSI_Level2);

That inside the init section of a custom indicator solved it. Thanks