Scripts: MT5 to MT4 Set File Converter - page 2

 
Unfortunately, the different numerical representations of some ENUMs (in particular ENUM_TIMEFRAMES and ENUM_APPLIED_PRICE) are not taken into account.
 

@Richard Gunning, thank you for you script!

Unfortunately, it can't be used with some ENUMs (TIMEFRAME, APPLIED_PRICE) because numerical values differs for MT4 and MT5.

Are you going to fix it?

Thanks again.

 
Hello, your converter does not work on MT5? because I would like to convert my indicator to MT4 but your converter does not work, unless I do not understand how to use it, can you help me, thank you very much
 
binaire72 # :

J'ai aimé un indicateur MT5 et je l'ai converti en fichier de jeu MT4 à l'aide de votre script. Mais vous ne savez pas comment utiliser le fichier de jeu MT4 sans le fichier MQL4/ex4.

Comment puis-je charger le fichier de jeu MT4 converti sur le graphique MT4 sans les fichiers MT4/ex4 ?

Est-il possible de convertir le fichier MQL5 en fichier MQL4 ?.

hello, how did you do with this script to convert, because i can't, can you help me?
 

ENUM_TIMEFRAMES and ENUM_APPLIED_PRICE cannot be taken into account: the set file does not save information about the type - and guessing the type from variable names is not a sensible idea.

This is a fairly common problem and can be circumvented by introducing another type that will be predictably converted in code to a value suitable for the platform.

For example, store an integer value of minutes, and interpret it in MT4 code by a simple conversion, and in MT5 code by a slightly more complex switch

And then there is the problem of incompatible timeframes, which is a separate issue.


I looked into the script code and found out that it does not handle some situations correctly.

For example, if a value contains "equals" signs.

Or if the value is empty (we get "(null)" in the MT4 network)

Fixed

Files:
 
Didn't work at all
 

Script, thank you.

I have changed the following points to use it.


Fix: Source code style formatted to Google style by ClangFormat. (Apologies. Personal preference.)

FIX: Changed to skip comment lines.

Fix: Don't use Split() for parameter/value extraction so that the '=' in the value is not removed.

Added: change certain parameters to other values. Parameter/value pairs are read from the [ChangeKeyValue] section of the 'SetFileConveter.ini' file.

Added: Change the value of the ENUM_TIMEFRAMES type parameter to a value for MT4. The ENUM_TIMEFRAMES type parameters to be converted are read from the [TimeframeKey] section of the 'SetFileConveter.ini' file.

Additional: Change the value of the ENUM_APPLIED_PRICE type parameter to the value for MT4. The ENUM_APPLIED_PRICE type parameter to be converted is read from the [PriceKey] section of the 'SetFileConveter.ini' file.

The 'SetFileConveter.ini' is placed in 'MQL5/Files'. The contents are described as follows.

[ChangeKeyValue]
MaxSpreadPips=1.0
NormalSpreadPips=0.5
SummerTimeType=2

[TimeframeKey]
WaitForNextEntry_TF
EXIT_BY_BB_TF_

[PriceKey]
ENTRY_BY_BB_Price
EXIT_BY_BB_Price

The modified source code is attached below.
Files:
 
The sections of the "SetFileConverter.ini" file can now be specified on a file-by-file basis.
Specify by adding '| file name' after the section name. An example description is shown below.
[ChangeKeyValue]
MaxSpreadPips=1.0
NormalSpreadPips=0.5
SummerTimeType=2

[TimeframeKey]
WaitForNextEntry_TF
EXIT_BY_BB_TF_

[TimeframeKey | CheckTheTrend.set]
CheckTF1_GMMA
CheckTF2_GMMA
CheckTF3_GMMA
CheckTF4_GMMA
CheckTF5_GMMA
CheckTF6_GMMA

[PriceKey]
ENTRY_BY_BB_Price
EXIT_BY_BB_Price

The modified source code is attached.

Files: