Exemplo n.º 1
0
        public static OHLCV operator +(OHLCV lhs, Decimal rhs)
        {
            OHLCV retVal = new OHLCV(lhs.DateTime);

            retVal.Close = lhs.Close + rhs;
            retVal.High  = lhs.High + rhs;
            retVal.Low   = lhs.Low + rhs;
            retVal.Open  = lhs.Open + rhs;
            return(retVal);
        }
Exemplo n.º 2
0
        public void Update(OHLCV Data)
        {
            if (Data.FirstDateTime < this.FirstDateTime)
            {
                this.FirstDateTime = Data.FirstDateTime;
                this.Open          = Data.Open;
            }

            if (Data.High > this.High)
            {
                this.High = Data.High;
            }

            if (Data.Low < this.Low)
            {
                this.Low = Data.Low;
            }

            if (Data.LastDateTime > this.LastDateTime)
            {
                this.LastDateTime = Data.LastDateTime;
                this.Close        = Data.Close;
            }
        }
Exemplo n.º 3
0
 public static double SquareError(OHLCV Prediction, OHLCV Actual)
 {
     return(Math.Pow((double)Prediction.Close - (double)Actual.Close, 2));
 }
Exemplo n.º 4
0
 public Bar(OHLCV Price, int BarNumber)
 {
     _ohlcv      = Price;
     this.Number = BarNumber;
 }
Exemplo n.º 5
0
 public static Decimal SquareError(OHLCV Prediction, OHLCV Actual)
 {
     return((Decimal)Math.Pow((double)(Prediction.Close - Actual.Close), 2));
 }