Esempio n. 1
0
 public CalculationData(double price, int barIndex, Point.SidePoint sideSwing)
 {
     isNewSwing     = true;
     this.price     = price;
     this.barIndex  = barIndex;
     this.sideSwing = sideSwing;
 }
Esempio n. 2
0
        // Protected (methods)

        protected virtual CalculationData OnCalculationOfFirstSwingPointRequest()
        {
            //logPrinter.Print(owner, "Virtual Calculation.OnCalculationOfFirstSwingPointRequest()");

            Point.SidePoint sideSwing = owner.Close.GetValueAt(0) > owner.Open.GetValueAt(0) ?
                                        Point.SidePoint.Low : Point.SidePoint.High;

            if (priceActionSwingClass.UseHighLow)
            {
                switch (sideSwing)
                {
                case Point.SidePoint.High:
                    return(new CalculationData(owner.High.GetValueAt(0), 0, sideSwing));

                case Point.SidePoint.Low:
                    return(new CalculationData(owner.Low.GetValueAt(0), 0, sideSwing));
                }
            }
            else
            {
                return(new CalculationData(owner.Open.GetValueAt(0), 0, sideSwing));
            }

            return(new CalculationData());
        }
Esempio n. 3
0
        private void AddUnknow(int index, double price, int barIndex, Point.SidePoint sideSwing)
        {
            //logPrinter.Print(owner, "Calculation.AddUnknow()");

            pointsList.Add(new Point(index, price, barIndex, sideSwing));
        }