Created ChartPainterInterface and moved ChartPainter intto sesim package

This commit is contained in:
2017-11-19 17:06:30 +01:00
parent da0b262fff
commit d3057f25df
16 changed files with 73 additions and 32 deletions

View File

@ -43,10 +43,14 @@ public class SMAIndicator implements Indicator {
this.parent = parent;
indicator = new OHLCData();
}
public void setParent(OHLCData parent){
}
int len = 20;
float getAt(int pos) {
private float getAt(int pos) {
if (parent.size() == 0) {
return 0;
}
@ -57,9 +61,7 @@ public class SMAIndicator implements Indicator {
}
float sum = 0;
for (int i = start; i <= pos; i++) {
//sum += parent.get(i).getAverage();
sum += parent.get(i).close;
}
return sum / (pos - start + 1);