public static List <Macd> createMACD(int M, int L, int S, List <Price> Price)
        {
            List <Macd> MACD = new List <Macd>();

            double[] _price = new double[Price.Count];

            for (int x = 0; x < Price.Count; x++)
            {
                _price[x] = Price[x].Close;
            }

            double[] macd    = new double[Price.Count];
            double[] trigger = new double[Price.Count];
            double[] hist    = new double[Price.Count];


            int a, b;


            Core.Macd(0, Price.Count - 1, _price, M, L, S, out a, out b, macd, trigger, hist);



            int zeroCount = 0;

            for (int x = 0; x < Price.Count; x++)
            {
                if (macd[x] == 0)
                {
                    zeroCount++;
                }
            }



            Debug.WriteLine("ZeroCount " + zeroCount);
            for (int x = 0; x < Price.Count - zeroCount; x++)
            {
                //Debug.WriteLine("Macd " + macd[x]);
                //Debug.WriteLine("Trigger " + trigger[x]);
                //Debug.WriteLine("Histo " + hist[x] * 2);
                //Debug.WriteLine(Price[x+zeroCount].TimeStamp + "   " + Price[x+zeroCount].Close);

                //Debug.WriteLine("===================");

                Macd m = new Macd();
                m.L           = L;
                m.M           = M;
                m.S           = S;
                m.TimeStamp   = Price[x + zeroCount].TimeStamp;
                m.Trigger     = trigger[x];
                m.Line        = macd[x];
                m.Histogram   = hist[x] * 2;
                m.Price_Close = Price[x + zeroCount].Close;
                m.Price_High  = Price[x + zeroCount].High;
                m.Price_Low   = Price[x + zeroCount].Low;
                m.Price_Open  = Price[x + zeroCount].Open;
                MACD.Add(m);
            }



            return(MACD);
        }
		public static List<Macd> createMACD(int M, int L, int S, List<Price> Price)
		{
			List<Macd> MACD = new List<Macd>();

			double[] _price = new double[Price.Count];

			for (int x = 0; x < Price.Count; x++)
			{
				_price[x] = Price[x].Close;


			}

			double[] macd = new double[Price.Count];
			double[] trigger = new double[Price.Count];
			double[] hist = new double[Price.Count];


			int a, b;


			Core.Macd(0, Price.Count - 1, _price, M, L, S, out a, out b, macd, trigger, hist);




			int zeroCount = 0;
			for (int x = 0; x < Price.Count; x++)
			{
				if (macd[x] == 0)
				{
					zeroCount++;
				}

			}




			Debug.WriteLine("ZeroCount " + zeroCount);
			for (int x = 0; x < Price.Count - zeroCount; x++)
			{
				//Debug.WriteLine("Macd " + macd[x]);
				//Debug.WriteLine("Trigger " + trigger[x]);
				//Debug.WriteLine("Histo " + hist[x] * 2);
				//Debug.WriteLine(Price[x+zeroCount].TimeStamp + "   " + Price[x+zeroCount].Close);

				//Debug.WriteLine("===================");

				Macd m = new Macd();
				m.L = L;
				m.M = M;
				m.S = S;
				m.TimeStamp = Price[x + zeroCount].TimeStamp;
				m.Trigger = trigger[x];
				m.Line = macd[x];
				m.Histogram = hist[x] * 2;
				m.Price_Close = Price[x + zeroCount].Close;
				m.Price_High = Price[x + zeroCount].High;
				m.Price_Low = Price[x + zeroCount].Low;
				m.Price_Open = Price[x + zeroCount].Open;
				MACD.Add(m);



			}






			return MACD;
		}