Topic: Bug: Swap Type Misinterpretation in Metatrader 5 Data Export Script
Hey Mr. Popov,
I've stumbled upon a little hiccup in the Data Export script for Metatrader 5 (Data Export.mq5).
Here's the scoop: it seems like there's a bug where the script misinterprets the swap type. For those familiar, the enumeration of swap types in Metatrader 4 is quite different from that in Metatrader 5.
In Metatrader 4, the values are as follows:
- 0 - in points
- 1 - in the symbol's base currency
- 2 - by interest
- 3 - in the margin currency
You can check it out here: https://book.mql4.com/appendix/marketinfo
Expert Advisor Studio aligns with this interpretation in its Symbol settings too.
Now, in Metatrader 5, the swap types are enumerated differently:
- 0 - Swaps disabled (no swaps)
- 1 - Swaps are charged in points
- 2 - Swaps are charged in money in the base currency of the symbol
- 3 - Swaps are charged in money in the margin currency of the symbol
- 4 - Swaps are charged in money, in client deposit currency
....
And so on... For the full list, visit: https://www.mql5.com/en/docs/constants/ … _swap_mode
This disparity leads to incorrect swap modes being exported in the Metatrader 5 Data Export script. Given these differences in enumeration, the Data Export script for MQ5 should ideally incorporate mappings to align swap types correctly with those in Metatrader 4 and Expert Advisor Studio.
Thanks for looking into this, and as always, happy trading, everyone!
Cheers!