Validate logic of DPO oscillator
Opened this issue · 0 comments
kenorb commented
double dpoBuffer[];
void calculateDPO() {
int startIndex = period / 2 + 1;
for (int i = 0; i < Bars - startIndex; i++) {
double sum = 0;
for (int j = 0; j < period; j++) {
sum += Close[i + j] - Close[i + j - startIndex];
}
dpoBuffer[i] = sum / period;
}
}