Documentation of 'org.encog.app.quant.util.BarBuffer' Java class
BarBuffer
org.encog.app.quant.util

Class BarBuffer



  • public class BarBuffer
    extends java.lang.Object
    A buffer of bar segments.
    • Constructor Summary

      Constructors 
      Constructor and Description
      BarBuffer(int thePeriods)
      Construct the object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(double d)
      Add a bar.
      void add(double[] d)
      Add a bar.
      double average(int idx)
      Average all of the bars.
      double averageGain(int idx)
      Get the average gain.
      double averageLoss(int idx)
      Get the average loss.
      java.util.List<double[]> getData() 
      boolean getFull()
      Determine if the buffer is full.
      double max(int idx)
      Get the max for the specified index.
      double min(int idx)
      Get the min for the specified index.
      double[] pop()
      Pop (and remove) the oldest bar in the buffer.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BarBuffer

        public BarBuffer(int thePeriods)
        Construct the object.
        Parameters:
        thePeriods - The number of periods.
    • Method Detail

      • add

        public final void add(double d)
        Add a bar.
        Parameters:
        d - The bar data.
      • add

        public final void add(double[] d)
        Add a bar.
        Parameters:
        d - The bar data.
      • average

        public final double average(int idx)
        Average all of the bars.
        Parameters:
        idx - The bar index to average.
        Returns:
        The average.
      • averageGain

        public final double averageGain(int idx)
        Get the average gain.
        Parameters:
        idx - The field to get the average gain for.
        Returns:
        The average gain.
      • averageLoss

        public final double averageLoss(int idx)
        Get the average loss.
        Parameters:
        idx - The index to check for.
        Returns:
        The average loss.
      • getData

        public final java.util.List<double[]> getData()
        Returns:
        The data.
      • getFull

        public final boolean getFull()
        Determine if the buffer is full.
        Returns:
        True if the buffer is full.
      • max

        public final double max(int idx)
        Get the max for the specified index.
        Parameters:
        idx - The index to check.
        Returns:
        The max.
      • min

        public final double min(int idx)
        Get the min for the specified index.
        Parameters:
        idx - The index to check.
        Returns:
        The min.
      • pop

        public final double[] pop()
        Pop (and remove) the oldest bar in the buffer.
        Returns:
        The oldest bar in the buffer.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.