Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
it depends a bit on what exactly you need and what you are looking at. If you have your variables in an array you can use the build in function NthExtremes for example.
There might be better ways to accomplish what you need, if you could provide an example of what exactly you are trying to do someone might be able to steer you in the right direction.
My idea is to have a descending sort among 4 values which they are coming from an experimental TS. The TS returns 4 values, two oh these ones are related to the maximum we suppose will occur for the next bar and the other two ones related to the minimum. These 4 values are not sorted and I have to sort correctly in order to define clearly which are the maximum values and what are related to the minimum. In Excel I could easly use the built-in LARGE function with "LARGE(A1:A4, 1) LARGE(A1:A4, 2) LARGE(A1:A4, 3) LARGE(A1:A4, 4)" to have in the same order MaxMax, MaxMed, MinMed, MinExt.
In EL I am thinking to use Array in this way (please let me know if there are mistakes):
//t defines the array
Array: myArray [3],0;
//put all final values from A1 to A4 variables into myArray to sort them correctly
myArray[0]=A1;
myArray[1]=A2;
myArray[2]=A3;
myArray[3]=A4;
Hi everyone,
I tried my experiment and I can confirm that it is a working solution. So If you want to sort some figures as for the Large function in Excel, you can use the SortArray as shown.
as I wrote above, the method is good to get an equivalent LARGE() function in EL but I add that if you want to use multicharts' PL you have to change the statment:
SortArray (myArray, 3, 1);
into
Array_sort(myArray, 0, 3, false);
Just for your information... and I apologize to you if I used a non appropriate section in this forum