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

WPR Customization - MetaTrader 5 Script | Forex Indicator Download - MT4/MT5 Resources

author EAcpu | 4 reads | 0 comments |

WPR Custom - indicator for MetaTrader 5

WPR Custom - indicator for MetaTrader 5

WPR Custom - indicator for MetaTrader 5

Set the following features as input parameters:

WPR Custom - indicator for MetaTrader 5

why do this

When testing an EA with the iWPR (Williams Percent Range, %R) standard indicator, the situation is always not promising: the indicator color cannot be changed (#1) and, most importantly, the level value is always the same (#2)!

WPR Custom - indicator for MetaTrader 5

At the same time, EAs based on iWPR can use the levels "-25" and "-75", but during visual testing only the strictly fixed levels of the indicator itself ("-20" and "-80") will be displayed. This display seemed inconvenient to me, so I made some settings on the input parameters.

Now, after being called from the EA, the indicator levels perfectly match the trading system. Call sample WPR customization implemented in Vlado EA, MQL5 code

 //--- Create a handle to the indicator iWPR handle_icustom= custom (m_symbol.Name(), Period (), “WPR Customization” ,Inp_WPR_Period,
                          Inp_WPR_Color, Inp_WPR_Width, Inp_WPR_Level1, Inp_WPR_Level2); //--- if the handle is not created if (handle_iCustom== INVALID_HANDLE )
    {
//--- Inform of failure and output error code print format ( "Unable to create handle of iWPR indicator for symbol %s/%s, error code %d" ,
                  m_symbol.Name(),
Enumeration to string ( period ()),
getLastError ());
//--- The indicator stops returning early ( initialization failed );
    }

And the results shown in the strategy tester:

WPR Custom - indicator for MetaTrader 5


Attachment download

📎 wpr_custom.mq5 (10.12 KB)

Source: MQL5 #22972

Verification code Refresh