Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Custom Bear Power Input - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resource

author EAcpu | 5 reads | 0 comments |

Custom Bears Power Inputs - indicator for MetaTrader 5

Custom Bears Power Inputs - indicator for MetaTrader 5

Custom Bears Power Inputs - indicator for MetaTrader 5

Two settings have been added to the input parameters: line color ( color ) and line width ( width ).

Custom Bears Power Inputs - indicator for MetaTrader 5

Why are line color ( color ) and line width ( width ) provided as input parameters, while line color and width in standard indicators can be changed manually ? If you test the strategy in the tester, or if the indicator is added to the chart by the Expert Advisor ( added via Chart Indicators ), Bears Power is always displayed with default color and width:

Custom Bears Power Inputs - indicator for MetaTrader 5

In my opinion, such a display is not very convenient, so here we customize an indicator to customize the bearing power input (use customization ), and pass the color and width through parameters.

 //--- Create a handle for the iBearsPower indicator handle_iBearsPower= custom (m_symbol.Name(), period (), "Customize Bears Power Input" ,
                            InpMAP period, Inp bear color , Inp bear with ); //--- if handle is not created if (handle_iBearsPower== INVALID_HANDLE )
    {
//--- Inform of failure and output error code printing format ( "Unable to create handle of iBearsPower indicator for symbol %s/%s, error code %d" ,
symbol (),
Enumeration to string ( period ()),
getLastError ());
//--- The indicator stops returning early ( initialization failed );
    }

This allows you to see prettier indicators on the tester or terminal chart:

Custom Bears Power Inputs - indicator for MetaTrader 5


Attachment download

📎 custom_bears_power_inputs.mq5 (7.78 KB)

Source: MQL5 #21781

Verification code Refresh