[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 350

 
Vinin:


No different from the option already offered
And your variant? IMHO, you can come up with other perversions, the essence of the desired result is known only to the author. Maybe from the opposite? What kind of characteristic he would like to see, to adapt the initial data (convert) to the output of the indicator.
 
granit77:
I'm not impressed.
Unimpressed means it doesn't meet the goal. What's the goal? Knock yourself out.
 
snail09:
How about you? IMHO, you can come up with other perversions, the essence of the desired result is known only to the author. Maybe the opposite is true? What characteristics he would like to see, to adapt the initial data (convert) to the output of the indicator.
The author does not know the essence of the desired result. The author wants to see what will come out of it :))
In a simplified form it's a task to numerically express the position of the point on the segment, where all distances are known. What is also known is that finding a point in the middle of the segment - the balance position, nothing happens. Closer to the upper boundary is a positive increment, closer to the lower boundary is a negative increment. As a hypothesis. And all variants are accepted. Even upside down.
 

How do I choose the higher of the 50 values? Thank you!

 
001:

How do I choose the higher of the 50 values? Thank you!

Sort by value and select first/last... Although there is a less costly option of a direct search.

How are the values stored?

 
001:

How do I choose the higher of the 50 values? Thank you!

Take the first and second values. Compare. Keep the larger of the two.

Take the third value and compare it with the highest of the previous two. We keep the highest value of those just compared.

We take the fourth value...

...

Take the fiftieth value and compare it to the highest of the previous two. Remains the greater of the values just compared.

 
tara:


They are stored in LocalSettings, it's up to the developers why.

I drag and drop them into MetaTrader, but I have to change the owner of the directories :(


Sorry for being clueless, but where is it? I have Windows 7, and I can't find LocalSettings on the C drive...
 
001:

How do I choose the higher of the 50 values? Thank you!

If you have an array of values, then:

int ArrayMaximum( double array[], int count=WHOLE_ARRAY, int start=0)
Search for the element with the maximum value. The function returns the position of the maximum element in the array.
Parameters:
array[] - Numeric array to search in.
count - Number of elements to search.
start - The start index for the search.
Example:
double num_array[15]={4,1,6,3,9,4,1,6,3,9,4,1,6,3,9}; int maxValueIdx=ArrayMaximum(num_array); Print("Max value = ", num_array[maxValueIdx]);
 

Here's a simple function for me:

int numberI()
    {
      for(int i=1;i<5;i++)
      {
         if(CTicketArray[i]!=0)
         {   
            Print(i);
         }   
        
      }
    }

I want my function to return only the maximum value of "i", how do I do that?

 
scooper:

I apologise for being clueless, but where is it? I have Windows 7, and I can't find LocalSettings on my C drive...

Sorry, I switched to 7 not too long ago - I answered from memory. Look in AppData in the Users folder, well - or just run a search (I did so).
Reason: