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
Check the errors (_LastError) - but don't forget to ResetLastError().
Very strange. I made a little change (removed the ArrayResize and used a constant). Error again:
I would start this in the debugger with _LastError as the first entry and then all other meaningful vars.
If I do that I get strange behaviour.
This line:
double Val1[];
causes in the debugger:
(_LastError is still 0)
now the next line:
ArrayResize(Val1,P_s_ma);
causes:
I don't think it's your fault - but I don't know what to do :(
I would start this in the debugger with _LastError as the first entry and then all other meaningful vars.
If I do that I get strange behaviour.
This line:
causes in the debugger:
(_LastError is still 0)
now the next line:
causes:
I don't think it's your fault - but I don't know what to do :(
Thank you for your effort. Now I'm sure that this is a bug (look at my previous post also).
I told it to the service desk - we'll see...
Total crazy. Look at this:
The result:
So solve the problem by using just a different name.
gooly:
causes in the debugger:
Hello,
According to some calculations I made, Val1 now requires around 450 Terabytes of RAM; I assume you do not have such a memory size on your computer, right ? :)
P.S. Ok , on to some remarks now
a)
int P_s_ma=(int)MathFloor(MathSqrt(s_ma_period));
you do not have to do all of the above, you can do that one
int P_s_ma=MathSqrt(s_ma_period); /* or, you can use sqrt() */
b)
I am pretty sure that there is no need also to ArrayInitialize() your arrays to 0 after they are being resized. It may be not documented (or at least I have not seen anything my self), but if you print the values of an array, you can see that they are initialised to zero during setting the size of the array; so, you may ArrayInitialize() if you would like values other than 0
c)
Regarding on how you are having legit prices for Val2 but not for Val1, as in
You can restart the editor and execute once more and see what happens. I have seen a strange behaviour like that my self as well, some times maybe the memory gets reused for a given variable name, while you are working in the same session
best regards