here is my code. it doesn't work.
Use dynamic array for the time variable.Next you need to use zero for the start_pos;Then useing not equal operator is better than the greater operator.Also I use ArrayFree(time) at the end of fuctions.
datetime time[]; CopyTime(Symbol(),PERIOD_M1,0,1,time); if(time[0]!=t) { t = time[0]; return true; } else { return false; }
- www.mql5.com
Use dynamic array for the time variable.Next you need to use zero for the start_pos;Then useing not equal operator is better than the greater operator.Also I use ArrayFree(time) at the end of fuctions.
the problem is not the function isNewbar.
the problem is how to use the Class CiAC. it prints the values like these:
see , every miniutes it prints a iac value , but the value is wrong.
the problem is not the function isNewbar.
the problem is how to use the Class CiAC. it prints the values like these:
see , every miniutes it prints a iac value , but the value is wrong.
I am pretty sure the problematic part of your code is isNewbBar .the function doesn't work properly ,so the indicator value seems to show the same value constantly.Do change the function as I've constructed.If it didn't work,we would work on the indicator side.
No. it's not the function problem.
in mql5 reference.
the documentation about copytime says:
When copying the yet unknown amount of data, it is recommended to use dynamic array as a target array, because if the requested data count is less (or more) than the length of the target array, function tries to reallocate the memory so that the requested data fit entirely.
If you know the amount of data you need to copy, it should better be done to a statically allocated buffer, in order to prevent the allocation of excessive memory.
so my function is not the problem.
plus, i have tried replaced the code with yours. doesn't work too. i believe that the problem is how to use class CiAC.
Thanks anyway.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
here is my code. it doesn't work.