Help me how to SORT in ascending order

 

Hello

I am using 5 different Donchiand bands in chart. I like to show them their position according to their color and sort in ascending order as shown in attached image. But I really dont know how to do it. If I write codes how to sort in program, I will be dying. If there is a command or easy way for this kind of sorting, please advice me.

1000000 thanks

mithetnme

 
mithetnme:

Hello

I am using 5 different Donchiand bands in chart. I like to show them their position according to their color and sort in ascending order as shown in attached image. But I really dont know how to do it. If I write codes how to sort in program, I will be dying. If there is a command or easy way for this kind of sorting, please advice me.

I am assuming that you did not write this code, because if you did, sorting the 5 lights into order would be trivial. Sorting 5 numbers into the correct order is also trivial. But if you have no ability to write code and no interest in learning then you are on the wrong forum. i believe there is an associated JOB area where you can pay someone to do all the work for you.
 
dabbler:
I am assuming that you did not write this code, because if you did, sorting the 5 lights into order would be trivial. Sorting 5 numbers into the correct order is also trivial. But if you have no ability to write code and no interest in learning then you are on the wrong forum. i believe there is an associated JOB area where you can pay someone to do all the work for you.


Hello dabbler

Thank you for your assumption.

I have been writing some programs for my own use in my job since after I learnt QBasic and Dbase IV in 1996. But I am not familiar with C Language (never used that one) and MQL4 is quite similar with C. Hence I am not expert in MQL4. I've already written many custom forex indicators whenever I need to use but I actually modified them, not created the new ones. In above image, indicator in right side of chart window (mithetnme family) and in first separate window (mithetnme 2T3sto) are my own ones and I wrote them myself. But I honestly confess that I didnt find any built in command for sorting out in MQL4 or may be due to my lack of knowledge, I cant make sorting. I can write some codes for this purpose, but as you know which one is easier 2+2+2+2+2+2+2+2+2+2 = 20 or 2 * 10= 20. But I can only write 2+2+2+2+2+2+2+2+2+2 = 20 in MQL4 programming. So I want to know if there is a built in SORT command in MQL4 just like multiplication, instead of addition so many times. If you are a MQL4 guru and if you are willing to help anyone, PLEASE HELP ME. If you do so, I and somebuddy will gain at least one more knowledge.

I found that coders guru and some other people are helping by explaining all questions on this forum. Besides I already got some helps from them. I have only limited ability to write MQL4 code and I am seriously willing to learn this language so you found my asking help here. But you said "But if you have no ability to write code and no interest in learning then you are on the wrong forum" and I feel really surprised to see your comment. If you are an administrator or a moderator of this forum, I do apologize for coming wrong place and I will be surely going out.

Thanks again

mithetnme

 
mithetnme:
So I want to know if there is a built in SORT command in MQL4
Use this and you would have found this
 
mithetnme:



I have been writing some programs for my own use in my job since after I learnt QBasic and Dbase IV in 1996. But I am not familiar with C Language (never used that one) and MQL4 is quite similar with C. Hence I am not expert in MQL4.

You could use

int ArraySort( double&array[], int count=WHOLE_ARRAY, int start=0, int sort_dir=MODE_ASCEND) 

although that doesn't look easy and I have never used it myself. I just write my own Insertion Sort or whatever.

Why don't you just write what you want to do in QBASIC, which shouldn't be more than a dozen or so lines, and I (or somebody else) will help you translate it into C. (Most here will be quite happy to help you, just not do it all for you.)

 
dabbler:

You could use

although that doesn't look easy and I have never used it myself. I just write my own Insertion Sort or whatever.

Why don't you just write what you want to do in QBASIC, which shouldn't be more than a dozen or so lines, and I (or somebody else) will help you translate it into C. (Most here will be quite happy to help you, just not do it all for you.)


Thanks a lot for your advice. I will surely try to use this command.

Although I started my programming with QBasic and Dbase IV, I used Visual Basic 6 ( Microsoft Studio 6) and Visual Dbase 7 since 1998/99.

my apology for my words.

Regds

mithetnme

 

Hello dabbler

Now I can make it. Thanks a lot.

mithetnme

Reason: