public void Trix(int startIdx, int endIdx, double[] inReal, int timePeriod = 1)
 {
     var outReal = new double[inReal.Length];
     int begIdx, nbElement;
     var rc = TAC.Trix(startIdx, endIdx, inReal, timePeriod, out begIdx, out nbElement, outReal);
     //if (rc == TAC.RetCode.Success)
 }
 public void Adx(int startIdx, int endIdx, double[] inHigh, double[] inLow, double[] inClose, int timePeriod = 1)
 {
     var outReal = new double[inClose.Length];
     int begIdx, nbElement;
     var rc = TAC.Adx(startIdx, endIdx, inHigh, inLow, inClose, timePeriod, out begIdx, out nbElement, outReal);
     //if (rc == TAC.RetCode.Success)
 }
        // RSI Stochastic

        /*public TAResult RsiX(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.StochRsi(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);
         * }*/

        // https://www.marketvolume.com/technicalanalysis/roc.asp
        // https://www.marketvolume.com/quotes/calculateroc.asp
        public TAResult Roc(int timePeriod = 14, int startIndex = -1, int endIndex = -1)
        {
            var outReal = new double[inReal.Length];
            int begIdx, nbElement;
            var rc = TAC.Roc(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));
        }
        // https://www.marketvolume.com/quotes/stochastics.asp
        public TAResult Stochastic(int fastKPeriod = 9, int slowKPeriod = 14, TAC.MAType slowKMAType = TAC.MAType.Sma, int slowDPeriod = 20, TAC.MAType slowDMAType = TAC.MAType.Sma)
        {
            var outSlowK = new double[inClose.Length];
            var outSlowD = new double[inClose.Length];
            int begIdx, nbElement;
            var rc = TAC.Stoch(startIdx, endIdx, inHigh, inLow, inClose, fastKPeriod, slowKPeriod, slowKMAType, slowDPeriod, slowDMAType, out begIdx, out nbElement, outSlowK, outSlowD);
            //if (rc == TAC.RetCode.Success)
            var values  = outSlowK.Take(outSlowK.Length).Reverse().ToArray();
            var values2 = outSlowD.Take(outSlowD.Length).Reverse().ToArray();

            return(new TAResult(begIdx, nbElement, values, values2));
        }
        /*public TAResult Roc(int timePeriod = 14, int startIndex = -1, int endIndex = -1)
         * {
         *  var outReal = new double[inReal.Length];
         *  int begIdx, nbElement;
         *  var rc = TAC.Roc(startIdx, endIdx, inReal, timePeriod, out begIdx, out nbElement, outReal);
         *  //if (rc == TAC.RetCode.Success)
         *  var values = outReal.Take(nbElement).Reverse().ToArray();
         *  return new TAResult(begIdx, nbElement, values);
         * }*/

        // https://www.marketvolume.com/quotes/macd.asp
        public TAResult Macd(int fastPeriod = 12, int slowPeriod = 26, int signalPeriod = 9, int startIndex = -1, int endIndex = -1)
        {
            var outMACD = new double[inReal.Length];
            var outMACDSignal = new double[inReal.Length];
            var outMACDHist = new double[inReal.Length];
            int begIdx, nbElement;
            var rc = TAC.Macd(startIdx, endIdx, inReal, fastPeriod, slowPeriod, signalPeriod, out begIdx, out nbElement, outMACD, outMACDSignal, outMACDHist);
            //if (rc == TAC.RetCode.Success)
            var values = outMACDHist.Take(nbElement).Reverse().ToArray();

            return(new TAResult(begIdx, nbElement, values));
            //var values = outMACDHist.Take(outMACDHist.Length).Reverse().ToArray();
            //var values2 = outMACD.Take(outMACD.Length).Reverse().ToArray();
            //var values3 = outMACDSignal.Take(outMACDSignal.Length).Reverse().ToArray();
            //return new TAResult(begIdx, nbElement, values, values2, values3);
        }