Exemple #1
0
 protected internal void Analysize(Catalog.Chart chart)
 {
     if (GetCheckOnTime(chart.Date))
     {
         Short.Pop();
         Long.Pop();
     }
     Short.Push(Short.Count > 0 ? EMA.Make(specify.Short, Short.Count, chart.Price, Short.Peek()) : EMA.Make(chart.Price));
     Long.Push(Long.Count > 0 ? EMA.Make(specify.Long, Long.Count, chart.Price, Long.Peek()) : EMA.Make(chart.Price));
 }
Exemple #2
0
        protected internal void Analysize(Catalog.Chart chart)
        {
            var input = GetCheckOnTime(chart.Date);

            if (input)
            {
                Short.Pop();
                Long.Pop();
            }
            double st = Short.Count > 0 ? Short.Peek() : chart.Price, lt = Long.Count > 0 ? Long.Peek() : chart.Price;

            if (input == false && (lCollection || sCollection))
            {
                var date = chart.Date.ToString();
                date = date.Length == 8 ? date.Substring(2) : date;

                switch (specify.Time)
                {
                case 1440:
                    date = date.Substring(0, 6);
                    break;

                default:
                    if (date.Length > 8)
                    {
                        date = date.Substring(0, 10);
                    }

                    break;
                }
                if (sCollection)
                {
                    ShortValue[date] = st;
                }

                if (lCollection)
                {
                    LongValue[date] = lt;
                }
            }
            Short.Push(Short.Count > 0 ? EMA.Make(specify.Short, Short.Count, chart.Price, st) : EMA.Make(chart.Price));
            Long.Push(Long.Count > 0 ? EMA.Make(specify.Long, Long.Count, chart.Price, lt) : EMA.Make(chart.Price));

            if (specify.Time == 1440 && chart.Volume != 0 && GetCheckTime(chart.Date.ToString()))
            {
                OnReceiveTrend(chart.Volume);
            }
        }