Questions from Beginners MQL5 MT5 MetaTrader 5 - page 443
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
So it's worth adding more prints and seeing where the algorithm goes.
Installed 880 build of MT4 - compiles without errors, but terminal crashes (old build works correctly).
After starting another terminal and compiling there - under old build, I start terminal with new build and get error when trying to change EA (invoke editor) 2015.09.19 22:23:11.272 MetaEditor not found - start in terminal mode
Errors when launching the EA
2015.09.19 22:29:49.948 2014.01.20 21:30 Kamikadze_MA_V_04_42_Fibo_04.ex4 GBPUSD,M15: OrderSend error 4051
2015.09.19 22:29:49.948 2014.01.20 21:30 Kamikadze_MA_V_04_42_Fibo_04.ex4 GBPUSD,M15: invalid amounts for OrderSend function
Installed 880 build of MT4 - compiles without errors, but terminal crashes (old build works correctly).
After starting another terminal and compiling there - under old build, I start terminal with new build and get error when trying to change EA (invoke editor) 2015.09.19 22:23:11.272 MetaEditor not found - start in terminal mode
Errors when launching the EA
2015.09.19 22:29:49.948 2014.01.20 21:30 Kamikadze_MA_V_04_42_Fibo_04.ex4 GBPUSD,M15: OrderSend error 4051
2015.09.19 22:29:49.948 2014.01.20 21:30 Kamikadze_MA_V_04_42_Fibo_04.ex4 GBPUSD,M15: invalid lots amount for OrderSend function
А
do you put it in your code?А
Put it in your code?Please tell me how to create a global variable with variable name generation - it should be "Variable name_Magic number".
You can do this, or you can be guided by:Variables
I don't understand the answer - let me clarify the question. I have code, where there is an external variable Magic - its value is set by user, I need to ensure the relative stability of the system after enabling / disabling the terminal, because there is some algorithm inside the program that does statistical calculations and its last value is important for running the algorithm. I decided to take a global variable for storing calculation data but it should be bound to a certain EA - it would be logical to bind it by magic - thus obtaining "global variable name+Magic" variable name. So the question is, how to generate a new variable name correctly?
Stability and an external variable that can be edited by the user are already incompatible conditions. Example: the first run - the user has changed the external variable, you have bound to this prefix in your code. Terminal restarts and user changes external variable again. What will you do?
In your algorithm, the last calculated value (the one that is very important after the restart) - what type is it? Double? If it is not, there will be problems.
Stability and an external variable that can be edited by the user are already incompatible conditions. Example: the first run - the user has changed the external variable, you have bound to this prefix in your code. Terminal restarts and user changes external variable again. What will you do?
In your algorithm, the last calculated value (the one that is very important after the restart) - what type is it? Double? If not, there will already be a problem.
Well, the user is me, so it's not supposed to change anything frantically. What other options are there? In init put recalculation and search for the right value?
The variable is int, but you can use double - it is not important - it will store integers.
... Because inside the program there is an algorithm that performs statistical calculation and its last value is important for running the algorithm. I decided to take a global variable for storing calculation data but it should be bound to a certain EA - it would be logical to bind it with magic - in this way, the variable name "name of global variable+Magic" will be generated. So the question is, how to generate a new variable name correctly?
What's wrong with that? :