NexusFi: Find Your Edge


Home Menu

 





EasyLanguage question-help


Discussion in TradeStation

Updated
    1. trending_up 2,060 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
auato
Bradenton
 
Posts: 30 since May 2016
Thanks Given: 6
Thanks Received: 4

Hi,
I just started to study EL few days ago.
How is it possible to implement the LARGE built-in function in EXCEL in EL in a smart way?

Thank you all,
auato


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Roland Garros Final Day: $3M on Zverev at 80.5% -- Leban …
Prediction Markets & Event Contracts
$500M Riding on World Cup 2026: France/Spain Co-Favored …
Prediction Markets & Event Contracts
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
April FOMC Minutes: Most Divided Fed Since 1992 -- Many …
Traders Hideout
Sundays Verdict: Lebanon Locked at 99.85% as Iran June 7 …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
16 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

auato,

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.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:
  #3 (permalink)
auato
Bradenton
 
Posts: 30 since May 2016
Thanks Given: 6
Thanks Received: 4


Thank you,

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;

SortArray (myArray, 3, 1);

MaxExt= myArray[0];
MaxMed=myArray[1];
MinMed= myArray[2];
MinExt= myArray[3];


Thank yoy,
Ciro


Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

Ciro,

the code looks like it would do what you have in mind, but you might want to test it with a simple example by giving A1 to A4 some values

Regards,

ABCTG


Follow me on X Reply With Quote
  #5 (permalink)
auato
Bradenton
 
Posts: 30 since May 2016
Thanks Given: 6
Thanks Received: 4

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.

Auato


Reply With Quote
Thanked by:
  #6 (permalink)
auato
Bradenton
 
Posts: 30 since May 2016
Thanks Given: 6
Thanks Received: 4

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


Reply With Quote




Last Updated on June 6, 2016


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts