Hey guys
So I coded a program that will look for all the rectangles on chart then change the color based on certain conditions. Now the problem I'm encountering is that when for example I draw one rectangle even if the condition is met the color don't change but as soon as I create a new rectangle, the first now change color based of the conditions. Same for the newly created rectangle, even if conditions are met, color won't change unless I create a new. Seems like conditions don't work on the last rectangle drawn or something like that. If anyone can help. Will be nice.
You can help yourself. Use the Debugger to see where and why your program acts different as you planned it.
Read this to know how: https://www.mql5.com/en/articles/654
- www.mql5.com
Make sure you call ChartRedraw every time you change an object's properties so the change is reflected on the chart.
The docs say it's only necessary when you change an object's properties, and I don't program for MT5 much, but if you also create / delete an object and the change isn't reflected, try calling ChartRedraw afterwards.
Make sure you call ChartRedraw every time you change an object's properties so the change is reflected on the chart.
The docs say it's only necessary when you change an object's properties, and I don't program for MT5 much, but if you also create / delete an object and the change isn't reflected, try calling ChartRedraw afterwards.
Yeah, I called ChartRedraw eachtime I modified properties just after
You can help yourself. Use the Debugger to see where and why your program acts different as you planned it.
Read this to know how: https://www.mql5.com/en/articles/654
Thanks for reply but sadly it's a mql4 program not mql5
Hey guys
So I coded a program that will look for all the rectangles on chart then change the color based on certain conditions. Now the problem I'm encountering is that when for example I draw one rectangle even if the condition is met the color don't change but as soon as I create a new rectangle, the first now change color based of the conditions. Same for the newly created rectangle, even if conditions are met, color won't change unless I create a new. Seems like conditions don't work on the last rectangle drawn or something like that. If anyone can help. Will be nice.
Make sure you call ChartRedraw every time you change an object's properties so the change is reflected on the chart.
The docs say it's only necessary when you change an object's properties, and I don't program for MT5 much, but if you also create / delete an object and the change isn't reflected, try calling ChartRedraw afterwards.
Resolved. Thanks for help
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
So I coded a program that will look for all the rectangles on chart then change the color based on certain conditions. Now the problem I'm encountering is that when for example I draw one rectangle even if the condition is met the color don't change but as soon as I create a new rectangle, the first now change color based of the conditions. Same for the newly created rectangle, even if conditions are met, color won't change unless I create a new. Seems like conditions don't work on the last rectangle drawn or something like that. If anyone can help. Will be nice.