Overlay has been modified to not redraw on every bar - MetaTrader 4 Script | Forex Indicators Download - MT4/MT5 Resources


Image: Modified USDJPY/USDCHF overlay (4-hour chart)
The original overlay chart is used to display two currencies or two assets on one chart.
The relative price of one currency can be displayed in terms of another currency.
For example, on the EURUSD chart, using this indicator, you can add USDCHF and the USDCHF price will be displayed as EURUSD price.
This can be useful for strategies that rely on convergence or divergence of two currencies or assets. Some people refer to this informally as "correlation" or "arbitrage" or more formally as "cointegration" strategies or "relative value".
Changes/Updates/Improvements
The original indicator will refocus its calculations on each bar, so the price will constantly move up and down, so the historical relative value does not remain constant. The indicator is modified so that the "center" or initial relative reference point remains fixed and does not update each bar. It only updates the initial center point (reinitialization) when the indicator is reloaded or settings are changed. (The indicator does show the current price change on the same chart, though, just to clarify).
This indicator also depicts history from long ago, whereas the original indicator does not. I may have also changed a couple of things in the original code, you can find the original code here .
enter
The SET CENTER input is which bar in history the indicator should use as a fixed initial point to compare 2 bars. currency or assets.
Attachment download
📎 modified_overlay_chart.mq4 (17.38 KB)
Source: MQL5 #26289
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •