sever-seven

Trader
Apr 25, 2024
2
0
6
53
Version 1.02 released to simplify the MT5 indicator and introduce minor improvements into the MT4 indicator.
Hello.
It seems to me that there is a typo in the code and it needs to be swapped.
MQL5:
input string IndexPairs = "EURUSD, USDJPY, GBPUSD, USDCAD, USDSEK, USDCHF";
IndexCoefficients = "-0.576, 0.136, -0.119, 0.091, 0.036, 0.042"; // Index coefficients: do not change for USDX.
...
USDSEK^0,042*USDCHF^0,036
 
Last edited by a moderator:

Enivid

Administrator
Staff member
Nov 30, 2008
19,210
1,504
144
Odesa
www.earnforex.com
Hello.
It seems to me that there is a typo in the code and it needs to be swapped.
MQL5:
input string IndexPairs = "EURUSD, USDJPY, GBPUSD, USDCAD, USDSEK, USDCHF";
IndexCoefficients = "-0.576, 0.136, -0.119, 0.091, 0.036, 0.042"; // Index coefficients: do not change for USDX.
...
USDSEK^0,042*USDCHF^0,036
Yes, you right! Thanks for reporting!
 

Cooper Co

Trader
Jun 24, 2024
3
0
6
44
Hi all. Thank you for your time. I'd like to know whether I can use this indicator to compare futures pairs also and if so how do I go about it. I tried updating the input pairs before compiling the file insider the mt5 editor with the names of my pairs but nothing showed on the indicators window on MT5 and It came back with error messages. Can someone help me with this please?
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,210
1,504
144
Odesa
www.earnforex.com
Hi all. Thank you for your time. I'd like to know whether I can use this indicator to compare futures pairs also and if so how do I go about it. I tried updating the input pairs before compiling the file insider the mt5 editor with the names of my pairs but nothing showed on the indicators window on MT5 and It came back with error messages. Can someone help me with this please?
You don't need to recompile it, you can change the currency pairs it uses via input parameters. Make sure you are setting the names correctly. Also, make sure you are updating the coefficient correctly for pairs that get inverted. For example, as far as I know, the futures pair for CHF is calculated (CHF/USD, not as USD/CHF), so the weight should be changed to negative.

If you are still getting some errors, please report them here.
 

Cooper Co

Trader
Jun 24, 2024
3
0
6
44
You don't need to recompile it, you can change the currency pairs it uses via input parameters. Make sure you are setting the names correctly. Also, make sure you are updating the coefficient correctly for pairs that get inverted. For example, as far as I know, the futures pair for CHF is calculated (CHF/USD, not as USD/CHF), so the weight should be changed to negative.

If you are still getting some errors, please report them here.
Thank you very much. Do you know the date range of data I will need to download to calculate to coefficiency of the pairs please?
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,210
1,504
144
Odesa
www.earnforex.com
Thank you very much. Do you know the date range of data I will need to download to calculate to coefficiency of the pairs please?
It doesn't matter. If you are using the same currencies, you just use the same coefficients but paying attention to their signs - inverting the sign if the futures symbol is inverted compared to the respective currency pair.
 

Cooper Co

Trader
Jun 24, 2024
3
0
6
44
It doesn't matter. If you are using the same currencies, you just use the same coefficients but paying attention to their signs - inverting the sign if the futures symbol is inverted compared to the respective currency pair.
Thank you for your patience with me. I'm perhaps not as versed as you so maybe I don't understand something and it is late here in England :) I understand I need Index Coefficients values to match the index pairs...BUT the markets I wish to track aren't "pairs" specifically but futures contracts ( S&P 500, NASDAQ, DOW and Gold futures ) I understand I still need the coefficient values for the markets to display and this is what I tried perhaps poorly to convey. I'd appreciate one last input from you so I completely understand but take into consideration it's way past my bedtime. lol. Thank you!
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,210
1,504
144
Odesa
www.earnforex.com
Thank you for your patience with me. I'm perhaps not as versed as you so maybe I don't understand something and it is late here in England :) I understand I need Index Coefficients values to match the index pairs...BUT the markets I wish to track aren't "pairs" specifically but futures contracts ( S&P 500, NASDAQ, DOW and Gold futures ) I understand I still need the coefficient values for the markets to display and this is what I tried perhaps poorly to convey. I'd appreciate one last input from you so I completely understand but take into consideration it's way past my bedtime. lol. Thank you!
Sorry, I thought you were trying to re-create the same USDX index but using the currency futures instead of currency pairs.

In your case, you need to set your own coefficients and the starting value (which is 50.14348112 in the original dollar index). You can choose the coefficients and the starting value however you want - depending on what you want to achieve.