How to compare a number of separate numerical variables?

Hi friends

I want to compare a list of variables and find out which ones are closer in value, they are all numerical and calculated separately. How can this be done? Say the variable are A1 through 7 (A1-A2-...)

Thanks!

@Solitude79 are your A1...A7 variable scalars or arrays?
In any case I think you should look at the VarGet() function to retrieve their values dynamically. Search the forum for additional examples.
Then, for example, you can use nested loops to determine the minimum difference between them (in case of arrays you may need an additional external loop to go over all the bars).

Thanks for the reply. They are arrays...exactly how I can use those nested loops is beyond me. Is there an example you could point me towards so that I can study it? Or a tutorial.

@Solitude79,

You joined in August 2017 yet you still don't have "Verified Badge"!

Only users with "Verified Badge" are allowed to post on this forum.

Search "Verified Badge" for more information on how to get verified.

1 Like