public void DirectionalMovementIndex(int startIdx, int endIdx, double[] inReal, int timePeriod = 1)
 {
     var outReal = new double[inReal.Length];
     int begIdx, nbElement;
     var rc = TAC.Rsi(startIdx, endIdx, inReal, timePeriod, out begIdx, out nbElement, outReal);
     //if (rc == TAC.RetCode.Success)
 }
        // https://www.marketvolume.com/quotes/calculatersi.asp
        public TAResult Rsi(int timePeriod = 14, int startIndex = -1, int endIndex = -1)
        {
            var outReal = new double[inReal.Length];
            int begIdx, nbElement;
            //var rc = TAC.Rsi(startIdx, endIdx, inReal, timePeriod, out begIdx, out nbElement, outReal);
            var rc = TAC.Rsi(startIdx, endIdx, inReal, timePeriod, out begIdx, out nbElement, outReal);
            //if (rc == TAC.RetCode.Success)
            var values = outReal.Take(nbElement).Reverse().ToArray();

            //var values = outReal.Take(outReal.Length).Reverse().ToArray();
            return(new TAResult(begIdx, nbElement, values));
        }