Beispiel #1
0
        public override TimeValueData getIndicator()
        {
            double upperBond = (ma.getIndicator().value *valueNow) + (std.getIndicator().value *stdMultiplicator);
            double lowerBond = (ma.getIndicator().value *valueNow) - (std.getIndicator().value *stdMultiplicator);

            double value = (valueNow - lowerBond) / (upperBond - lowerBond);

            if (value > 1)
            {
                value = 1;
            }

            if (value < 0)
            {
                value = 0;
            }

            return(new TimeValueData(timestampNow, value));
        }
        public override double getIndicator()
        {
            double upperBond = (ma.getIndicator() * valueNow) + (std.getIndicator() * stdMultiplicator);
            double lowerBond = (ma.getIndicator() * valueNow) - (std.getIndicator() * stdMultiplicator);

            double value = (valueNow - lowerBond) / (upperBond - lowerBond);

            if (value > 1)
            {
                value = 1;
            }

            if (value < 0)
            {
                value = 0;
            }

            return(value);
        }