Custom Basket Index Line
Comparing raw prices across instruments is meaningless the moment they trade at different scales - EURUSD at 1.08 and USDJPY at 155 cannot be averaged directly into anything useful. This indicator solves that by rebasing every basket member to 100 at one shared reference bar, so each member's line (and their weighted combination) reads as a percentage move from that common starting point regardless of the instrument's native price scale. The naive way to pick a reference point is "the leftmost bar currently on screen", but that quietly redefines the whole index every time the chart is scrolled or zoomed. This indicator instead fixes the rebase point to one calendar time - either supplied explicitly or, by default, the oldest bar every basket member has history for - and reuses that same reference for as long as the indicator stays loaded, so the line does not silently reshape itself as more history streams in. Up to eight symbols can be included, each with its own weight, letting the basket represent anything from an equal-weighted currency group to a deliberately skewed exposure line. Notes and limitations - All eight symbols must be available on the terminal (in Market Watch or reachable via history download) or that member is silently skipped for bars where its data is missing, and the weighted average is computed from whichever members do have data at that bar. - The rebase point, once established, is held fixed for the life of the chart/indicator instance; removing and re-adding the indicator (or an account/history change that shifts available history) can produce a different rebase bar and therefore a different absolute level, though the shape of the line is unaffected. - This is a comparison and exposure-visualisation tool, not a tradeable synthetic price feed - it cannot be used as the symbol argument to order or history functions.
Indicator · MT4 · v1.0 · Free
About Custom Basket Index Line
Custom Basket Index Line is an indicator for MetaTrader 4. It shows several symbols in one panel. It has 18 settings, such as Symbol1, Weight1 and Symbol2. MQL source code included.
Files in the download: CustomBasketIndexLine.ex4, CustomBasketIndexLine.mq4, CustomBasketIndexLine.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Symbol1 | EURUSD | Basket member 1, blank to disable |
| Weight1 | 1.0 | Weight for member 1 |
| Symbol2 | GBPUSD | Basket member 2, blank to disable |
| Weight2 | 1.0 | Weight for member 2 |
| Symbol3 | AUDUSD | Basket member 3, blank to disable |
| Weight3 | 1.0 | Weight for member 3 |
| Symbol4 | NZDUSD | Basket member 4, blank to disable |
| Weight4 | 1.0 | Weight for member 4 |
| Symbol5 | Basket member 5, blank to disable | |
| Weight5 | 1.0 | Weight for member 5 |
| Symbol6 | Basket member 6, blank to disable | |
| Weight6 | 1.0 | Weight for member 6 |
| Symbol7 | Basket member 7, blank to disable | |
| Weight7 | 1.0 | Weight for member 7 |
| Symbol8 | Basket member 8, blank to disable | |
| Weight8 | 1.0 | Weight for member 8 |
| Symbol suffix | Broker suffix appended to every symbol, leave blank if none | |
| Rebase time | 0 | Rebase time (0 = the oldest common bar across all members) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: EURUSD · USDJPY · Dashboards & Scanners · MT4 Indicator · MQL4 Source Code