public class Indicator extends java.lang.Object implements Signal
Signal.Direction
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_SEUIL |
protected int |
n1 |
protected int |
n2 |
protected double |
seuil |
Constructor and Description |
---|
Indicator(int n1,
int n2) |
Indicator(int n1,
int n2,
double seuil) |
Modifier and Type | Method and Description |
---|---|
void |
checkParameters() |
Signal.Direction |
update(OrderBook asset,
Day day)
Compare le prix courant au prix a t-n1, puis au prix a t-n2 (0 < n1 < n2)
Si ce sont 2 hausses de prix (d'au moins seuil %), on achete
Si ce sont 2 baisses de prix (d'au moins seuil %), on vend
|
public static final double DEFAULT_SEUIL
protected double seuil
protected int n1
protected int n2
public Indicator(int n1, int n2)
public Indicator(int n1, int n2, double seuil)
public void checkParameters()
public Signal.Direction update(OrderBook asset, Day day)