Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1426
![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
Do you want to sort the values in both lines or just the first line?
Only in the first one. There's an error in the code.
I'm sorry... I don't know how to delete the code. So I will just say that in block 2 instead of LoY[S2][0]=Bid; you need LoY[0][52]=Bid;
Why can't I swap rows and columns at once?
If you do the right order at once, can you name the numbers of the cells you want to fill with the value 0.5555?
Why can't I swap rows and columns at once?
Then ArrayFill(LoY,0,10,0.5555); will not work. But it needs array elements in which it changes values to go *in sequence*. But if I feed it LoY[31][2]
, then the elements of the array where I want to change the value will go through 1. In this case, it will first "add" the 31 lines of the array into one line in order.
If you want to do it in the right order, can you tell me the numbers of the cells you want to fill with 0.5555?
The first row contains cells one through ten. But once you've filled them with 0.5555, the whole first row has to be sorted... let's say in ascending order. ArrayFill(LoY,0,10,0.5555) instead of ArrayFill(LoY,0,10,0.5555) doesn't suit me.
I corrected the errors in the code
here's the script:
result:
is it or isn't it?
here's the script:
result:
Is it or isn't it?
Thank you very much. This looks like what I need. But I would appreciate it if you could put this code not as a script but into my code. This way I'll understand and assimilate new information faster. Only I have price values in the array instead of integers.
Thanks again for your help.
ArrayFill()
use
If it needs to be filled in differently, then instead of
use
Ok. Today I hope to absorb some new information for me. And I'll let you know the results tomorrow.
Thanks again.
code not as a script, but paste it into my code.
I didn't write anything else, I just repeated your code.
Visually the numbers are not arranged correctly (in two lines, instead of 31), and you thought that's what you need.
Most likely, you may have needed to assign 0.5555 to the loop instead of ArrayFill. Try it.