As you may know I published a number of indicators, which provide volume delta analysis in MetaTrader, including Forex. For example, there exist VolumeDelta, VolumeDeltaM1, and CumulativeDeltaBars for MetaTrader 4, as well as their counterparts for MetaTrader 5. Among them, VolumeDelta is the origin and groundwork for all other products.
According to customer's requests, the volume delta could benefit from an oscillator representation of volume based curves. Actually VolumeDelta is an oscillator itself, but some people want probably to have a constant range for easy detection of overbought/oversold state. I'm not sure this makes the indicator readings more reliable because normalization to a range, say, from 0 to 1, is only a wishful thinking. Nevertheless I decided to implement a simple indicator wrapper capable of building standard WPR on existing volume delta buffers. So said, so done. It's ready. And it's powered by VolumeDelta or delta bars (VolumeDeltaBars for MT5, CumulativeDeltaBars for MT4) called via iCustom, and calculates standard formula of Williams Percent Range.
The source code is compatible both with MetaTrader 4 and 5. It's attached below twice (in 2 files with .mq4 and .mq5 extensions for your convenience, but they are the same). 2 compiled versions are also provided.
WPR on VolumeDelta in MetaTrader 4
Data Window in MetaTrader 4 while setting up WPR on VolumeDelta
WPR on CumulativeDeltaBars in MetaTrader 4
WPR on VolumeDeltaBars in MetaTrader 5 with buffer setup in Data Window
Please, note that VolumeDelta, VolumeDeltaBars, or CumulativeDeltaBars indicator is required. You should specify relative path to it in the parameter Engine. For example, if VolumeDelta is installed in Indicators/Market folder, write "Market\VolumeDelta" into Engine parameter. Also note, that the engine is not required on the chart itself (on all screenshots above the engine indicator is added only for reference). Moreover, if you place the indicator with underlying engine to the same chart as VolumeDeltaWPR, make sure to disable all on-chart objects in the indicator parameters, because otherwise the instance of the engine running in background from VolumeDeltaWPR will try to hide the objects, and 2 instances may interfere with each other producing flickering on the screen. Default engine is "VolumeDelta".
WPR is calculated on data from one of underlying buffers, which is selected by EngineBuffer parameter. By default it's 3, which is cumulative delta curve of VolumeDelta. Make sure you select proper index buffer for specific engine indicator. You may open Data Wndow to see which buffers have which ordinal numbers.
Of course you can play with WPR period using WPRPeriod parameter. But periods less than period of VolumeDelta itself may have no sense (depends from selected buffer index).
Also it may be important to have most recent versions of the engine indicators.