Exemple #1
0
        /// <summary>
        /// прогрузить только последнюю свечку
        /// </summary>
        private void ProcessOne(List <Candle> candles)
        {
            if (candles == null)
            {
                return;
            }

            _moveAverage.Add(GetMoveAverage(candles, candles.Count - 1));
            _rangeAverage.Add(GetRangeAverage(candles, candles.Count - 1));
            _rvi.Add(GetRvi(candles.Count - 1));


            if (ValuesUp == null)
            {
                ValuesUp = new List <decimal>();
                ValuesUp.Add(GetValue(candles, candles.Count - 1));

                ValuesDown = new List <decimal>();
                ValuesDown.Add((GetValueSecond(candles, candles.Count - 1)));
            }
            else
            {
                ValuesUp.Add(GetValue(candles, candles.Count - 1));
                ValuesDown.Add(GetValueSecond(candles, candles.Count - 1));
            }
        }
        /// <summary>
        /// прогрузить только последнюю свечку
        /// </summary>
        private void ProcessOne(List <Candle> candles)
        {
            if (candles == null)
            {
                return;
            }

            if (ValuesUp == null)
            {
                ValuesUp   = new List <decimal>();
                ValuesDown = new List <decimal>();
            }

            _t1.Add(GetT1(candles, candles.Count - 1));
            _t2.Add(GetT2(candles, candles.Count - 1));

            _tM1.Process(_t1);
            _tM2.Process(_t2);

            _k.Add(GetK(candles.Count - 1));
            _kM.Process(_k);

            ValuesUp.Add(Math.Round(_k[_k.Count - 1], 2));
            ValuesDown.Add(Math.Round(_kM.Values[_kM.Values.Count - 1], 2));
        }
Exemple #3
0
        /// <summary>
        /// прогрузить только последнюю свечку
        /// </summary>
        private void ProcessOne(List <Candle> candles)
        {
            if (ValuesUp == null)
            {
                ValuesUp   = new List <decimal>();
                ValuesDown = new List <decimal>();
                ValuesUp.Add(GetValueUp(candles, candles.Count - 1));
                ValuesDown.Add(GetValueDown(candles, candles.Count - 1));
            }
            else
            {
                ValuesUp.Add(0);
                ValuesDown.Add(0);

                ValuesUp[ValuesUp.Count - 3]     = (GetValueUp(candles, candles.Count - 1));
                ValuesDown[ValuesDown.Count - 3] = (GetValueDown(candles, candles.Count - 1));

                if (ValuesDown[ValuesDown.Count - 3] != 0)
                {
                    ValuesDown[ValuesDown.Count - 4] = 0;
                    ValuesDown[ValuesDown.Count - 5] = 0;
                }

                if (ValuesUp[ValuesUp.Count - 3] != 0)
                {
                    ValuesUp[ValuesUp.Count - 4] = 0;
                    ValuesUp[ValuesUp.Count - 5] = 0;
                }
            }
        }
Exemple #4
0
 /// <summary>
 /// прогрузить только последнюю свечку
 /// </summary>
 private void ProcessOne(List <Candle> candles)
 {
     CalculateAverageCandle(candles);
     CalculateMinMax(candles);
     ValuesUp.Add(maxValue);
     ValuesDown.Add(minValue);
 }
Exemple #5
0
 /// <summary>
 /// удалить данные
 /// </summary>
 public void Clear()
 {
     if (ValuesUp != null)
     {
         ValuesUp.Clear();
         ValuesDown.Clear();
     }
 }
Exemple #6
0
 /// <summary>
 /// удалить данные
 /// </summary>
 public void Clear()
 {
     if (ValuesUp != null)
     {
         ValuesUp.Clear();
         ValuesDown.Clear();
     }
     _myCandles = null;
 }
        /// <summary>
        /// перегрузить последнюю ячейку
        /// </summary>
        private void ProcessLast(List <Candle> candles)
        {
            if (candles == null)
            {
                return;
            }
            List <decimal> values = GetIndicatorValues(candles, candles.Count - 1);

            ValuesUp.Add(values[0]);
            ValuesDown.Add(values[1]);
            ValuesAvg.Add(values[2]);
        }
Exemple #8
0
        /// <summary>
        /// прогрузить только последнюю свечку
        /// </summary>
        private void ProcessOne(List <Candle> candles)
        {
            if (candles == null)
            {
                return;
            }

            if (ValuesUp == null)
            {
                ValuesUp   = new List <decimal>();
                ValuesDown = new List <decimal>();
            }

            ValuesUp.Add(GetUpValue(candles.Count - 1));
            ValuesDown.Add(GetDownValue(candles.Count - 1));
        }
Exemple #9
0
        /// <summary>
        /// прогрузить только последнюю свечку
        /// </summary>
        private void ProcessOne(List <Candle> candles)
        {
            if (candles == null)
            {
                return;
            }

            if (ValuesUp == null)
            {
                ValuesUp = new List <decimal>();
                ValuesUp.Add(GetMacd(candles.Count - 1));
            }
            else
            {
                ValuesUp.Add(GetMacd(candles.Count - 1));
            }
            _maSignal.Process(ValuesUp);
        }
Exemple #10
0
 public override void OnStateChange(IndicatorState state)
 {
     if (state == IndicatorState.Configure)
     {
         _seriesDown = CreateSeries("FractalDown", Color.OrangeRed, IndicatorChartPaintType.Point, true);
         _seriesUp   = CreateSeries("FractalUp", Color.DeepSkyBlue, IndicatorChartPaintType.Point, true);
         _seriesDown.CanReBuildHistoricalValues = true;
         _seriesUp.CanReBuildHistoricalValues   = true;
     }
     else if (state == IndicatorState.Dispose)
     {
         if (ValuesUp != null)
         {
             ValuesUp.Clear();
         }
         if (ValuesDown != null)
         {
             ValuesDown.Clear();
         }
     }
 }
Exemple #11
0
        /// <summary>
        /// прогрузить только последнюю свечку
        /// </summary>
        private void ProcessOne(List <Candle> candles)
        {
            if (candles == null)
            {
                return;
            }
            if (ValuesDown == null)
            {
                ValuesUp   = new List <decimal>();
                ValuesDown = new List <decimal>();

                decimal[] value = GetValueSimple(candles, candles.Count - 1);

                ValuesUp.Add(value[0]);
                ValuesDown.Add(value[1]);
            }
            else
            {
                decimal[] value = GetValueSimple(candles, candles.Count - 1);

                ValuesUp.Add(value[0]);
                ValuesDown.Add(value[1]);
            }
        }
Exemple #12
0
        /// <summary>
        /// прогрузить только последнюю свечку
        /// </summary>
        private void ProcessOne(List <Candle> candles)
        {
            if (candles == null)
            {
                return;
            }

            if (MasTrend == null)
            {
                MasTrend = new List <decimal>();
            }
            if (MasHp == null)
            {
                MasHp = new List <decimal>();
            }
            if (MasLp == null)
            {
                MasLp = new List <decimal>();
            }
            if (MasAf == null)
            {
                MasAf = new List <decimal>();
            }
            if (psar == null)
            {
                psar = new List <decimal>();
            }

            if (Values == null)
            {
                Values = new List <decimal>();
            }
            if (ValuesUp == null)
            {
                ValuesUp = new List <decimal>();
            }
            if (ValuesDown == null)
            {
                ValuesDown = new List <decimal>();
            }

            decimal[] dop = new decimal[6];
            if (Values.Count == 0)
            {
                dop = GetValueParabolicSar(candles, candles.Count - 1, 0, 0, 0, 0, 0, 0);
            }
            else
            {
                dop = GetValueParabolicSar(candles, candles.Count - 1, 0, Values[Values.Count - 1], MasTrend[MasTrend.Count - 1],
                                           MasHp[MasHp.Count - 1], MasLp[MasLp.Count - 1], MasAf[MasAf.Count - 1]);
            }

            if (dop[0] > candles[candles.Count - 1].High)
            {
                ValuesDown.Add(dop[0]);
                ValuesUp.Add(0);
            }
            else if (dop[0] < candles[candles.Count - 1].Low)
            {
                ValuesUp.Add(dop[0]);
                ValuesDown.Add(0);
            }
            else
            {
                ValuesUp.Add(0);
                ValuesDown.Add(0);
            }


            Values.Add(dop[0]);
            MasTrend.Add(dop[1]);
            MasHp.Add(dop[2]);
            MasLp.Add(dop[3]);
            MasAf.Add(dop[4]);
        }