Try this, it should be more properly:
#include <Indicators/trend.mqh> CiMA extMA; int OnInit() { extMA.Create(Symbol(),Period(),10,0,MODE_SMA,PRICE_CLOSE); // setup length of indicator buffer as you need extMA.BuffSize(neededNumber); return(0); } void OnTick() { extMA.Refresh(-1); // update all MA values Comment(extMA.Main(0)); }
It is BufferResize(lenghofthebuffer).
For the rest everything works, thank you so, i mean it's crazy that a post more than 10 years ago is so useful.
For the rest everything works, thank you so, i mean it's crazy that a post more than 10 years ago is so useful.
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
I would like to use the classes derived from CIndicator (CiMA, CiStochastic etc) but have had no success.
The code below always shows DBL_MAX
Perhaps I need to use extMA.Refresh(flags), but if so I can't find a value of flags that will work.
Paul
http://paulsfxrandomwalk.blogspot.com/