指定
MAIN CONCEPT:
The request is to create an indicator chart, showing the weighted average of prices taken from a list of different markets (with a maximum of 10). We will call it custom index (shortly, CX). As an example from forex market, the CX would be based on a formula similar to the Dollar Index, i.e. a combination of different currency pairs.
The weights of different assets in the CX will be expressed as X/100 in a range 1-100 (the total will be normalized to reach 100/100). If no specific weights are indicated, the CX will set by default as 1/N for each of N markets.
Prices should not be taken as NET prices, but as VARIATIONS in PERCENTAGE, starting form a given date (zero point). The aim is to allow the combination of prices that may have completely different levels, for example on stocks or equity indexes.
OUTPUT CHART:
The output chart will be drawn as candlestick on OHLC values. Also, a set of basic indicators will be drawn on CX chart, based on CX closing values:
-moving averages (on the CX chart)
-Bollinger Bands (on the CX chart)
-ATR (under the CX chart)
-momentum (under CX chart)
NOTES:
In case a price is not available (example, quotations started later, or missing data) then the CX will generate an errore message saying "calculation can't be run before date gg/mm/yyyy (or time hh:mm) because data missing on market XXX".
As an alternative option, in case of missing data on a specific market, CX might fix this issue by recalculating the weights of other market, assigning the missing quota among them. This may happen in case there are gaps of missing prices (on one or more markets) within the interval of drawing.