A dynamic array must be resized before using/
datetime BarTim[]; //--- Emanem definovanй promмnnй bool Is2or4digits=true; //false for ALPARI, true for FxCast double VyskaBaru,Bo,Bh,Bl,Bc; //Konstantnн vэљka barщ jako Value hodnta double BorderDif; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() {//--- indicator buffers mapping SetIndexBuffer(0,BarOp,INDICATOR_DATA); SetIndexBuffer(1,BarHi,INDICATOR_DATA); SetIndexBuffer(2,BarLo,INDICATOR_DATA); SetIndexBuffer(3,BarCl,INDICATOR_DATA); SetIndexBuffer(4,FastEMABuffer,INDICATOR_DATA); SetIndexBuffer(5,SlowEMABuffer,INDICATOR_DATA); IndicatorSetInteger(INDICATOR_DIGITS,_Digits); //--- ArrayResize(BarTim,1); BarTim[1]= TimeLocal(); return(0); }
Rosh:
A dynamic array must be resized before using/
Thanks Rosh for answer, I mast study mach more !!!
Bohem
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
Does anybody know why I can't writa to dynamic array?
There is run time error "Array out of range in 'TestDynFile.mq5' (64,7)".
When I declare it as static, it is OK. File si attached.
Thanks for any answer(s).
Bohem