I am finding that my code is reading the wrong value for the average on some days of the week compared with the indicator displayed in the window.
This seems to have something to do with the fact that the shift appears to run from Wednesday to wednesday rather than monday to monday.
This code appears to be correct on Monday and tuesday
Code: Select all
SlowLWMA = GetMa(symbol,LongPeriod,2,1,MODE_LWMA,PRICE_OPEN ,1);Code: Select all
SlowLWMA = GetMa(symbol,LongPeriod,2,1,MODE_LWMA,PRICE_OPEN ,0);Code: Select all
double GetMa(string symbol,int tf, int period, int mashift, int method, int ap, int shift) {
return(iMA(symbol, tf, period, mashift, method, ap, shift) );
}