Hello Dear friend Apprentice.
This request is for MT4, ok?
What I have in mind is this indicator which will use the COT Index formula and will have some user inputs to make it flexible.
I got those indis from forexfactory which are a currency strength indicator which gave me the idea to use it with the COT Index formula. I have attached the indis to this post. There is a daily and weekly version.
Ok, so we have the COT Index formula which is: 100 x (current Net – Minimum Net) / (maximum Net – Minimum Net)
100 * (X-B)/(A-B)
where
X = current currency strength value
A = maximum currency strength value
B = minimum currency strength value
The user must give to the indicator the max and min values and also the look back period for calculation. Because, let's say I am interested only in the most recent price action, of the last 3 months for example, then I will load the Strength_waves_all_daily_101.ex4 indicator and scan the chart 3 months back in time and see the max and min levels reached, then I will put that data in currency strength index indicator you are gonna code, in the max and min levels inputs, and use a look back period of 90 days, for example, in this case.
Or if I am interested in the yearly data, I would load again the Strength_waves_all_daily_101.ex4 and then scan the chart for the max and min levels for this period of one year, would put this levels in the max and min inputs of the indicator and choose a look back period of 52 weeks or 365 days (depends of which version of the indicator we use, daily or weekly)
But since we gonna have to do this for the currencies we are interested in, I believe we need an input for the currency too. Because if we are gonna be using the indicator to trade a pair, you are gonna be interested in the two currencies that form that pair, right? So you scan the currencies you are interested in using Strength_waves_all_daily_101.ex4, and write down the data for the currencies you want to analyze.
For example, you wanna trade the EUR/USD and is interested in the yearly data. Then you load Strength_waves_all_daily_101.ex4 and check the max and min levels that EUR and USD reached in one year, write that down.
Then you load the currency strength index (which is the indicator requested to be coded based on COT Index formula). The inputs will have to be:
Look Back: 52 Weeks (Or 365 days)
Currency A: EUR
Max: "N1"
Min: "N2"
Line Color: Yellow
Currency B: USD
Max: "N1"
Min: "N2"
Line Color: Green
Then the indi will plot the index for the pair using two independent lines, but if you leave currency B empty for example (USD in this case), then the indi calculates the index only for EUR (in the case you are only interested in seeing the strength of only one currency).