Loading…

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

SettingDefaultWhat it does
Symbol1EURUSDBasket member 1, blank to disable
Weight11.0Weight for member 1
Symbol2GBPUSDBasket member 2, blank to disable
Weight21.0Weight for member 2
Symbol3AUDUSDBasket member 3, blank to disable
Weight31.0Weight for member 3
Symbol4NZDUSDBasket member 4, blank to disable
Weight41.0Weight for member 4
Symbol5Basket member 5, blank to disable
Weight51.0Weight for member 5
Symbol6Basket member 6, blank to disable
Weight61.0Weight for member 6
Symbol7Basket member 7, blank to disable
Weight71.0Weight for member 7
Symbol8Basket member 8, blank to disable
Weight81.0Weight for member 8
Symbol suffixBroker suffix appended to every symbol, leave blank if none
Rebase time0Rebase time (0 = the oldest common bar across all members)

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: EURUSD · USDJPY · Dashboards & Scanners · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria