wslamvin00:
Can anyone help to check what wrong with my code?
If i put rsiHistory[30], it will initialize the array, but what if I do not want it to be a fixed array, i want it to be Dynamic? please help
<CODE DELETED>
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
You cannot use Dynamic arrays in mql4, if you want to make an Array bigger or smaller then resize it using ArrayResize()
If you are using Buffers in an Indicator then they are automatically resized for you . . . you declare them like this
double Buffer[];
Play videoPlease edit your post.
For large amounts of code, attach it.
int start(){ double rsiHistory[]; <= Global not local IndicatorBuffers(1); <= in init() int ind_Counted = IndicatorCounted(); int a = Bars - ind_Counted - 31; int b = Bars - ind_Counted - 1; SetIndexBuffer(1, rsiHistory); <= in init() ArrayInitialize(rsiHistory, 0); <= delete, it's a indicator buffer
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Can anyone help to check what wrong with my code?
If i put rsiHistory[30], it will initialize the array, but what if I do not want it to be a fixed array, i want it to be Dynamic? please help