Merge origin/master
This commit is contained in:
@ -42,10 +42,14 @@ public class SMAIndicator extends BaseIndicator {
|
||||
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;
|
||||
}
|
||||
@ -56,9 +60,7 @@ public class SMAIndicator extends BaseIndicator {
|
||||
}
|
||||
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);
|
||||
|
Reference in New Issue
Block a user