just count OBV buf
and than create new while and count MAonarray
for (int j=0; j<OBV_MA_fast; j++){ MA_fast_temp+=iOBV(NULL,0,PRICE_CLOSE,i+j); } MA_fast_Buf[i]=MA_fast_temp/OBV_MA_fast;
Don't you want to zero your temp for each bar?- Handle your look backs correctly
int LB = MathMax(OBV_MA_fast, OBV_MA_slow); i=Bars-1-MathMax(LB,counted_bars); // Index of the first uncounted
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi All,
I am trying to create a moving average indicator of the OBV. However when I attach it to a chart, it grinds MT4 to a halt and sometimes even crashed MT4. Am I doing something fundamentally wrong here? I tried to first use iMAonArray and when that did not work, then tried to do it manually, however with the same degenerative result. Here is the code, can anyone see what is wrong with it?
Thx