Um, may I do it with class...
Like this.
Like this.
class CIndicatorBuffer { public: int mhandle; double mbuffer[]; bool mArraySetAsSeries(bool set) {return ArraySetAsSeries(mbuffer, set);} bool mSetIndexBuffer(int index, ENUM_INDEXBUFFER_TYPE data_type) {return SetIndexBuffer(index, mbuffer, data_type);} bool mPlotIndexSetInteger(int plot_index, ENUM_PLOT_PROPERTY_INTEGER prop_id, int prop_value) {return PlotIndexSetInteger(plot_index, prop_id, prop_value);} bool mPlotIndexSetString(int plot_index, ENUM_PLOT_PROPERTY_STRING prop_id, string prop_value) {return PlotIndexSetString(plot_index, prop_id, prop_value);} int mCopyBuffer(int count) {return CopyBuffer(mhandle, 0, 0, count, mbuffer);} }; CIndicatorBuffer MAA[iNum];
Files:
ma96_class_.mq5
6 kb
It can be compiled.
0 error(s), 0 warning(s),
but, 0 indicator(s).
Help me! Also for you!
0 error(s), 0 warning(s),
but, 0 indicator(s).
Help me! Also for you!
It seems the error occur when call CopyBuffer().
Returned Value is -1.
first call iMA() in a loop, return 10; later call, return 0. why?
memory leak?
It's terrible.
My MT5 can not open.
Restart windows.
It's OK, just move Param into CIndicatorBuffer as a member.
But why? array member cannot be a ma_period of iMA?
No, I has tested, iMA(NULL,0,Param[i],shift,smootMode,price) is OK.It's strange.
Files:
ma96_ok_.mq5
8 kb
It's OVER.
Congratulations.
I'm still not sure why it didn't work the first time for you. I noticed on the non-working one, you called the ArraySetAsSeries before SetIndexBuffer, then on the working one, you called it after. Think that was the bug?
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 want to show a lot of MA in a indicator.
So, if I can use two-dimensional array as buffer, It will briefly written form of circulation.
Like this:
How to do it?