Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1272
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Isn't there someone who can tell you?
Why did you paste the code with a picture? Do you think someone will retype the code from a picture and help you?
If you paste the whole code as a code instead of a picture, then there will be many more people willing to help...
what is your problem? what do you want to get out of your function?
I may understand it, then we can look for a solution together.
The catch is that the expression produces = 0
numPosOr= 4;
numStepCount= 1;
iK = (numPosOr - numStepCount) / numPosOr;
But logically it should be so,
at the beginning we count in brackets:
(numPosOr - numStepCount)= 4-1 = 3
then according to the formula:
3 / 4 = 0.75 - this is how the result should look like.
Why does it count = 0?
The problem is that the expression outputs = 0
numPosOr= 4;
numStepCount= 1;
iK = (numPosOr - numStepCount) / numPosOr;
But logically it should be so,
at the beginning we count in brackets:
(numPosOr - numStepCount)= 4-1 = 3
then according to the formula:
3 / 4 = 0.75 - this is how the result should look like.
Why does it count = 0?
The problem is that the expression outputs = 0
numPosOr= 4;
numStepCount= 1;
iK = (numPosOr - numStepCount) / numPosOr;
But logically it should be so,
at the beginning we count in brackets:
(numPosOr - numStepCount)= 4-1 = 3
then according to the formula:
3 / 4 = 0.75 - this is how the result should look like.
Why do I get = 0?
You have already been written several times to bring all code, if you have iK int type, it's ok to get 0 What type is your variable?
The problem is that the expression outputs = 0
numPosOr= 4;
numStepCount= 1;
iK = (numPosOr - numStepCount) / numPosOr;
But logically it should be so,
at the beginning we count in brackets:
(numPosOr - numStepCount)= 4-1 = 3
then according to the formula:
3 / 4 = 0.75 - this is how the result should look like.
Why does it count 0?
or
The problem is that the expression outputs = 0
numPosOr= 4;
numStepCount= 1;
iK = (numPosOr - numStepCount) / numPosOr;
But logically it should be so,
at the beginning we count in brackets:
(numPosOr - numStepCount)= 4-1 = 3
then according to the formula:
3 / 4 = 0.75 - this is how the result should look like.
Why do I get = 0?
Complex arithmetic - when there is no physical understanding of it.
What or why it is needed? may be in some places, need to prescribe a real figure, and then get, his final result?
Good day to all.
I recently started learning mql5. I was told here that when testing an EA in MT5, opening and closing orders are done on history with real historical floating spreads, which were at those moments in real trading.
There is no such thing in mql4. But we have the (int)MarketInfo("EURUSD",MODE_SPREAD) function that returns the value of spread when testing. Although it didn't return the real spread value, but the one I set in the settings.
Q: What function can be used to display the actual value of floating spread in the tester when an EA is opening and closing orders?
Thank you for your help.
I'm taking my first steps in MQL5 and I stumbled over a global variable.
Can you tell me how to change it from inside a block?
Or, if it's not possible, how to make "checkboxes" for EA logic?
Happy Economist Day everyone!
I have not found among standard functions of MT4 for work with arrays - function which finds first empty row (or value) in array (or with value "0")
What I mean:
Array [2] [7]
1-2
3-4
8-10
2-5
12-7
0-0
0-0
I need a function to determine if the first unfilled/zero value is in line [5].
ArrayMinimum for some reason I can't find minimum "0".
Array search is the only option for this task in MT4.
Thank you!
I would like to ask the experts - is such a template for an expert correct or is it better to organise the logic in another way?
It would be good to comment at the beginning of the functions, what do they do. It's a bit hard to read)