SMA Indicator

This commit is contained in:
2017-11-17 21:36:11 +01:00
parent fda75cbff8
commit 1858a65fe6
5 changed files with 41 additions and 27 deletions

View File

@ -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++) {

View File

@ -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;