Topics
Replies

vladimiroskyrkimtzis
13 Feb 2020, 11:14

RE:

PanagiotisCharalampous said:

Hi Vladimiros,

It seems I did not read your question well :) There is no built in function for this, you will need to write it yourself. Here is an example for finding the index for the maximum

        private int IndexOfMax(DataSeries series, int noOfBars)
        {
            double maximum = series[0];
            int maxIndex = 0;
            for (int i = 1; i < noOfBars; i++)
            {
                if (series[i] > maximum)
                {
                    maximum = series[i];
                    maxIndex = i;
                }
            }
            return maxIndex;
        }

Best Regards,

Panagiotis 

Join us on Telegram

Hi again,

Many thanks for clarifying and the suggested code, it works fine for my purpose!

Have a nice day.

Vladimiros

 


@vladimiroskyrkimtzis

vladimiroskyrkimtzis
12 Feb 2020, 22:01

RE:

PanagiotisCharalampous said:

Hi vladimiroskyrkimtzis

Try Minimum and Maximum functions. See below an example

Bars.HighPrices.Maximum(100);

Best Regards,

Panagiotis 

Join us on Telegram

 

Efxaristo Pano,

I am actually trying to establish the exact index in which the Max/Min occur. For example the functions you suggest will give me the Max price in the last 100 bars, but in which bar? Last 40th? Last 35th?

Hope there is an easy method to do this,

Vladimiros

 

 


@vladimiroskyrkimtzis