Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1040

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
IndicatorDigits(5)
Let me ask another question. Based on the same indicator. Let us assume that we attach the indicator to the chart. We obtain the first value of Bid1. Then we obtain the second value of Bid2. And we need to compare these two values. From the second one we subtract the first one and obtain the number that we add to the first Bid1.
Bid1=1.11133
Bid2=1.11135
Bid2-Bid1=0.00002
Bid1+0.00002=1.11135
I understand that the result is the same as in the original indicator.
I just want to see the implementation and understand the logic of the code.
You have to unlock it in the file properties.
Two statements:
Print: 22.33
И
Print: 2.00000
Why are there different outputs? In C / C ++ the above statement works fine.
Does anyone have any ideas about this problem?
Help me understand the price arrays in mt5. It's not clear in the indicator. I output prices, which are in OnCalculate:
I get strange prices:
I do it the other way around, I create an array and copy it (I look for it by trying, it's not clear to me):
And I get similar results:
It's even more interesting with dates. I print dates that are in OnCalculate:
I get this:
And when I copy it:
It prints out fine:
But you can't get far on dates alone. Help me understand. How do I get the correct opening and closing prices?
Help me deal with price arrays in mt5. It's not clear in the indicator. I output the prices that are in OnCalculate:
Make it like this:
You used wrong type specification in the formatted output
do this:
You used the wrong type specification in the formatted output
Aaaaahhhh, shit! Thank you very much, Igor!
I should have put %f... I've got it wrong... I also need to put ArraySetAsSeries everywhere. It's a little weird...
please
I would not advise to use ArraySetAsSeries() if you write the indicator code from scratch (if you port it from MQL4 - another matter),
use rates_total as the number of the right-most bar - 1, you will get used to the indicator logic in MQL5 quicker
Not writing from scratch... I'm transferring the mt4 indicator to mt5
Let me ask you another question. Based on the same indicator. Let us assume that we attach the indicator to the chart. We obtain the first value of Bid1. Then we obtain the second value of Bid2. And we need to compare these two values. From the second one we subtract the first one and obtain the number that we add to the first Bid1.
Bid1=1.11133
Bid2=1.11135
Bid2-Bid1=0.00002
Bid1+0.00002=1.11135
I understand that the result is the same as in the original indicator.
I just want to see the implementation and understand the logic of the code.
Help me. I can't get anything working on my own. I make 2 buffers x[ ] to compare Bid values and y[ ] to plot. And nothing.
I need your help. I can't get anything working on my own. I make 2 buffers x[ ] to compare Bid values and y[ ] to plot. And nothing.
Try asking the question differently, your question is probably not clear