SMA Indicator
This commit is contained in:
@ -211,6 +211,11 @@ public class Exchange {
|
||||
}
|
||||
|
||||
|
||||
public void addIndicator(Indicator i){
|
||||
this.indicators.add(i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void createTraders(JSONArray traderdefs) {
|
||||
for (int i = 0; i < traderdefs.length(); i++) {
|
||||
|
@ -61,8 +61,10 @@ public class SMAIndicator implements Indicator {
|
||||
}
|
||||
|
||||
void update(){
|
||||
if (parent.size()==0)
|
||||
return;
|
||||
|
||||
for (int i = indicator.size()-1;i<0;i++){
|
||||
for (int i = parent.size()-1;i<0;i++){
|
||||
OHLCDataItem p = parent.get(i);
|
||||
|
||||
float pr = this.getAt(i);
|
||||
@ -74,7 +76,7 @@ public class SMAIndicator implements Indicator {
|
||||
}
|
||||
}
|
||||
|
||||
OHLCData getData(){
|
||||
public OHLCData getData(){
|
||||
update();
|
||||
return indicator;
|
||||
|
||||
|
Reference in New Issue
Block a user