wing:
I want to record time[0] and time[1] every tick on
as ArrayResize is only for first dimension only,
I want to record time[0] and time[1] every tick on
as ArrayResize is only for first dimension only,
- If you are recording 2 things, the second dimension is constant. datetime times[][2]; ArrayResize(times,n+1); times[n][0]=...; times[n][1]=...;
- Otherwise use separate arrays. datetime times0[], times1[]; arrayresize(); arrayResize(); times0[n]=...; times1[n]= ...;
- Why are you using iTime(NULL,0,x) when the simpler Time[x] will do?
- Why are you recording those times, they will not be changing during the current candle?
1 & 2. that's ok, I will try another method to achieve the same purpose.
3 & 4. people here saying time by time that either you have to learn yourself or pay here, if you want to learn, you have to post your code.
It is because I am not good in coding skill, the original coding is really a mess (and is very complicated). As a result, code posted above this time is for learning purpose only, what I want to know is whether MQL4 allowed 2nd dimension of an array to be dynamic (and how in case of yes).
Anyway, your help is really appreciated, thanks a lot.
wing:
3 & 4. people here saying time by time that either you have to learn yourself or pay here, if you want to learn, you have to post your code.
what I want to know is whether MQL4 allowed 2nd dimension of an array to be dynamic (and how in case of yes).
3 & 4. people here saying time by time that either you have to learn yourself or pay here, if you want to learn, you have to post your code.
what I want to know is whether MQL4 allowed 2nd dimension of an array to be dynamic (and how in case of yes).
- Learn or pay refers to people that aren't asking a question, they don't want to learn, they are just saying 'code this for me.' If you are asking a question about your code, there's no mind readers here, you have to post your code.
- If you want a dynamic second dimension you'll have to do it yourself.
done.
thank you!
![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
Hi all,
I want to record time[0] and time[1] every tick on individual row of an array, i.e. on every new tick, a new row should be opened to record the figures.
here are my code:
as ArrayResize is only for first dimension only, I have no idea how to resize 2nd dimension (or, is it possible to let the 2nd dimension be dynamic in MQL4?)
Can anyone share your experience?
Thank you.
remark:
I have read the coding inside this article but, according to my standard, I really can't understand it: https://www.mql5.com/en/forum/106412
I also have read this article many times: https://book.mql4.com/variables/arrays
I also have read this too: https://www.mql5.com/en/forum/130330