org.encog.app.quant.util
public class BarBuffer extends Object
Constructor and Description |
---|
BarBuffer(int thePeriods)
Construct the object.
|
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.
|
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.
|
public BarBuffer(int thePeriods)
thePeriods
- The number of periods.public final void add(double d)
d
- The bar data.public final void add(double[] d)
d
- The bar data.public final double average(int idx)
idx
- The bar index to average.public final double averageGain(int idx)
idx
- The field to get the average gain for.public final double averageLoss(int idx)
idx
- The index to check for.public final List<double[]> getData()
public final boolean getFull()
public final double max(int idx)
idx
- The index to check.public final double min(int idx)
idx
- The index to check.public final double[] pop()
Copyright © 2014. All Rights Reserved.