HomeKnowledge Base

Adding custom grid levels to RSI indicator

Built-in RSI indicator offers the ability to display one of predefined grid levels to indicate oversold and overbought regions. This can be done in Axes&Grid tab of Parameters window available under right-mouse button.

Grid settings

If we require more flexibility, then as an alternative, we could modify the code and call PlotGrid function to display the custom grid lines. This allows to specify any level for the grids. A modified formula is presented below:

periods Param"Periods"151200);
oversold Param"Oversold level"151100);
overbought Param"Overbought level"851100);

PlotRSIperiods), _DEFAULT_NAME(), ParamColor"Color"colorCycle ), ParamStyle("Style")  );
PlotGridoversold );
PlotGridoverbought )

Param window settings

Now, since the formula uses Param function as input, the custom grid levels can be defined and modified in Parameters tab.

Comments are closed.