Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1028
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
Why can't the EA change the pending order price (sell stop) to a more profitable one?
Here is the function that defines the need to move the open price of a pending order
... and this is the function which already moves the open price of the pending order
Why can't the EA change the pending order price (sell stop) to a more profitable one?
Here is the function that defines the need to move the open price of a pending order
... And this is the function which already moves the open price of the pending order
Is this order the only one? Does the SLTP modification work? If not, the take and stop should be normalized
dist1 is equal to what? Here the order should be set instead of the position
Is the order the only one? Does SLTP modification work? If not, you should normalise the take and stop
dist1 is equal to what? We should set the order instead of the position
Thank you very much! I hadn't noticed that, it seems to be a trifle - but it doesn't work without it
... The order is the only one, everything works, the only problem was moving the pending order
Thank you very much! I hadn't noticed that, seemingly a small thing - but it doesn't work without it
... The order is the only one, everything works, the only problem was moving the pending order
1. Please 2. Hmm, I'll normalise it anyway, against the sin. Your price is obtained from the integer multiplied by a normalized double, in the general case apparently also a normalized double is obtained, but I read somewhere that not always, a couple of times a year it may get
something like 1.13250000000000000000001
and then trouble, at the right time, when the most powerful trend doesn't work, and the mortgage again, hello)))
I could be wrong, but I myself reassure and normalise always.
1. Please 2. Hmmm, I'm normalising anyway for sin's sake. You get the price from a whole multiplied by a normalised double, in the general case apparently you get a normalised double too, but I read somewhere that not always, a couple of times a year you might get
something like 1.13250000000000000000001
and then trouble, at the right time, when the most powerful trend doesn't work, and the mortgage again, hello)))
I could be wrong, but I myself reassure and normalise always.
Mathematical operations on two normalised numbers give non-normalised results.
In order to get a normalized result of mathematical operations with real numbers, you must return the normalized value of these mathematical operations.
Norm(1.11111) + Norm(2.22222) = NoNorm(res)
Norm(1.11111 + 2.22222) = Norm(res)
@ Artyom Trishkin
I have attached the code with this theme.
I found its code in the code base. There was a problem when changing the code.
The input part has the following entries:
I want this parameter to change while the program is running: input #ifdef __MQL4__ INT #else long #endif Inp_element_2542795 = 400 // Step grid, points.
Please let me know what I can do to change this parameter each time I run it.
@ Artyom Trishkin
I have attached the code with this theme.
I found its code in the code base. There was a problem when changing the code.
The input part has the following entries:
I want this parameter to change while the program is running: input #ifdef __MQL4__ INT #else long #endif Inp_element_2542795 = 400 // Step grid, points.
Please let me know what I can do to change this parameter each time I run it.
Honestly, the question is not clear.
Do you want to change the input parameter Inp_element_2542795 every time you start the adviser?
Well, change it in the advisor settings when it starts. Or, if the adviser is already running, and you want to change this parameter, then press F7 - the advisor settings window will appear, and change this parameter in it.
Honestly, the question is not clear.
Do you want to change the input parameter Inp_element_2542795 every time you start the adviser?
Well, change it in the advisor settings when it starts. Or, if the adviser is already running, and you want to change this parameter, then press F7 - the advisor settings window will appear, and change this parameter in it.
Let me clear. I guess the problem is translation. Actually, it is input value. and I am not getting where this value is getting used for the calculation. I do not want that every time 400 points should be used. I want to keep changing the values. I want to change the values to suitable calculation. Can you help me where I can make changes so that the value become dynamic during the program is running?
Let me clear it up. I think the problem is with the translation. It is actually an input value. and I don't understand where this value is used to calculate. I don't want 400 points to be used every time. I want to keep changing the values. I want to change the values for a suitable calculation. Can you help me where I can make changes so that the value becomes dynamic while the program is running?
Create a new global variable. Set the value of the input parameterInp_element_2542795 to it:
and replace the entire entry of the string Inp_element_2542795 with this new variable g_element_2542795 using Ctrl + H
Hello!
I'm just learning MQL5, so I'm asking for help.
There is a class -https://www.mql5.com/ru/code/18721(Vlad Karputova). Thanks to Vladimir.
It calculates profit (in points, in currency of deposit, swap and commission). But it has no filter for Magik.
I have added filter by Magik (I am not sure if it is correct, so I don't want to post it with errors).
Got the result.
Result for original class and class with filter by Magik coincide. But, there is one point here.
1.Why OUT trades have zero magic.
2.If I have incorrectly corrected the class (adding a magik) - please make the required change to the original class and post it.
(And it would be good to pass a symbol to the class as a parameter).
Thanks for the help.