Package org.jquantlib.math

Examples of org.jquantlib.math.IntervalPrice


    @Override
    public TimeSeries<Double> calculate(final TimeSeries<IntervalPrice> quotes) {
        final TimeSeries<Double> retval = new TimeSeries<Double>() { /* anonymous */ };
        final Iterator<Date> it = quotes.navigableKeySet().iterator();
        Date date = it.next();
        IntervalPrice prev = quotes.get(date);
        while (it.hasNext()) {
            date = it.next();
            final IntervalPrice curr = quotes.get(date);
            final double c0 = Math.log(prev.close());
            final double o1 = Math.log(curr.open());
            final double sigma2 = this.a * (o1 - c0) * (o1 - c0) / this.f + (1 - this.a) * delegate.calculatePoint(curr) / (1 - this.f);
            retval.put(date, Math.sqrt(sigma2 / delegate.getYearFraction()) );
            prev = curr;
        }
        return retval;
View Full Code Here


  @Override
  public TimeSeries<Double> calculate(final TimeSeries<IntervalPrice> quotes) {
    final TimeSeries<Double> retval = new TimeSeries<Double>() { /* anonymous */ };
    for (final Date date : Iterables.unmodifiableIterable(quotes.navigableKeySet())) {
            final IntervalPrice curr = quotes.get(date);
            retval.put(date, Math.sqrt(Math.abs(calculatePoint(curr)) / yearFraction) );
    }
    return retval;
  }
View Full Code Here

    @Override
    public TimeSeries<Double> calculate(final TimeSeries<IntervalPrice> quotes) {
        final TimeSeries<Double> retval = new TimeSeries<Double>(Double.class);
        final Iterator<Date> it = quotes.navigableKeySet().iterator();
        Date date = it.next();
        IntervalPrice prev = quotes.get(date);
        while (it.hasNext()) {
            date = it.next();
            final IntervalPrice curr = quotes.get(date);
            final double c0 = Math.log(prev.close());
            final double o1 = Math.log(curr.open());
            final double sigma2 = this.a * (o1 - c0) * (o1 - c0) / this.f + (1 - this.a) * delegate.calculatePoint(curr) / (1 - this.f);
            retval.put(date, Math.sqrt(sigma2 / delegate.getYearFraction()) );
            prev = curr;
        }
        return retval;
View Full Code Here

  @Override
  public TimeSeries<Double> calculate(final TimeSeries<IntervalPrice> quotes) {
    final TimeSeries<Double> retval = new TimeSeries<Double>(Double.class);
    for (final Date date : Iterables.unmodifiableIterable(quotes.navigableKeySet())) {
            final IntervalPrice curr = quotes.get(date);
            retval.put(date, Math.sqrt(Math.abs(calculatePoint(curr)) / yearFraction) );
    }
    return retval;
  }
View Full Code Here

TOP

Related Classes of org.jquantlib.math.IntervalPrice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.