
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
Purely about the task at hand. Remove value and empty
add a function so you can filter by criterion and you'll be good to go. You could even add it to your collection :-)
something like
to pull out all values greater than 3: arrayFilter<long>(array,3,GreaterThen<long>).
I'm not sure that MQL templates will allow to do it easily
I'm not imposing.
Thank you, you are kind today :-)
About the task. Imho it is more convenient to operate with a type from data collection likeCArrayDouble. My example:
There is a drawback though. The output will be a sorted array.
Ohhh, sometimes it's better to be silent and look like a fool than...
than to say anything and clear up any doubts....
There is an array containing a set of data of type 1,2,3,6,9,5,6,3,25,6,8,7,4 you need to remove e.g. values 3 and get the same array without 3 and empty spaces in the output...
I'm looking for the fastest way to clear an array of unnecessary values...
The following example comes to mind
Maybe there is a more economical and faster way ?
By looping through the array and removing unneeded values, you overwrite the value in the next cell in the place of the removed one. Shift to the left all values following the erased value and count the number of erased values in the counter.
Then do ArrayResize() taking into account the number of erased values.
Zy. Do not move the values you want to erase. You can shift to the left all values except the ones you erase.
The shift of values to the left should be equal to the number of erased cells.
A silly question is an unasked question.
I have several solutions to the problem, but I keep looking for better solutions and learning from others.
You have been asking similar questions for several years now. Have you learned much? Sorry, but you seem to have remained at the level of bytes and elementary arrays.
The question itself is formulated incorrectly. The task is not to remove repeating values (task of GCE level) but in something much bigger, you must update the list of valid items. If so, the question should sound completely different. You confuse and mislead the participants and, first of all, yourself: impose on the participants the wrong solution in principle and ask to make it effective.
By looping through the array and removing unwanted values from it, overwrite the value in the next cell in place of the removed value. Shift to the left all values following the erased value and count the number of erased values in the counter.
Then do ArrayResize() taking into account the number of erased values.
Zy. Do not move the values you want to erase. You can shift to the left all values except the ones you erase.
The shift of values to the left should be equal to the number of erased cells.
Check this option.
Sorry. It looks like the lines need to be reversed:
Sorry. It looks like the lines need to be reversed:
Riddle: How many apples will Pinocchio have if Pinocchio gives him two apples and Papa Carlo gives him three?
Answer: Ten. The source variables need to be initialized.
Sorry. It looks like the lines need to be reversed:
More work to be done: