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
Does this apply to the normal mode or the tester?
Normal mode, Nikolai.
Thank you!
Is this function not suitable?
Unfortunately not. It moves the bitmap object itself, I need a function that moves the content x points. I know that internally the memory consists of an x, y array but there is no memmove or something in mql. I don't know how to move the memory quickly.
Normal mode, Nikolai.
I usually follow the following scheme:
.
If it doesn't work in MT4, then something is wrong with the CHARTEVENT_CHART_CHANGE event. I can't check it now, there are no quotes yet.
I usually do the following:
If it doesn't work in MT4, then something is wrong with the CHARTEVENT_CHART_CHANGE event. I can't check it now, there are no quotes yet.
Nicholas, so that you don't waste your time, I wrote above a solution that solved my problem, namely, as you correctly noticed, the following code inserted into OnCalcucate():
Unfortunately not. It moves the bitmap object itself, I need a function that moves the content x points. I know that internally the memory consists of an x, y array but there is no memmove or something in mql. I don't know how to move the memory quickly.
I didn't get it, do you need to move the rectangular area inside the entire canvas?
Nicholas, so that you don't waste your time I wrote above a solution that solved my problem, namely, as you correctly noticed, the following code inserted into OnCalcucate():
In normal non-test mode you should not do this, because the ChartChanged() function will be executed twice in a row, which is not reasonable. After all, it is executed when the CHARTEVENT_CHART_CHANGE event occurs inside the iCanvas.mqh file.
It is correct to redraw your canvas bound to bars or time in OnChartEvent when the window change event ( CHARTEVENT_CHART_CHANGE) occurs without using ChartChanged().
Nicholas, so that you don't waste your time, I wrote above a solution that solved my problem, namely, as you correctly noticed, the following code inserted into OnCalcucate():
You need to take the following into consideration:
Your problem was because OnCalculate is apparently executed before OnChartEvent is executed and therefore ChartChanged() has not been executed yet.
That's why it is reasonable to implement the redraw handler exactly in OnChartEvent and not in On Calculate. Especially it should be done because the user can change the size of the window at any time. The CHARTEVENT_CHART_CHANGE event is responsible for all this
I didn't get it, do you need to move the rectangular area inside the whole canvas?
Yes. Example: I draw a circle in the middle of the full screen canvas and want to move the circle to the left, but I don't want to delete the entire area and repaint the circle with every movement, but simply scroll the memory to the left.
The CCanvas is simply an x/y Array of points.
I mean a function which moves the m_pixels to the left, right, up, down.
Yes. Example: I draw a circle in the middle of the full screen canvas and want to move the circle to the left, but I don't want to delete the entire area and repaint the circle with every movement, but simply scroll the memory to the left.
The CCanvas is simply an x/y Array of points.
I mean a function which moves the m_pixels to the left, right, up, down.
Yes, it's a reasonable wish.
All the more it is not difficult to implement it.
I thought about it, but I came to the conclusion that if there is a need to move the rectangular part of the common canvas, there is an easier way to implement it:
Yes, quite a reasonable desire.
All the more it is not difficult to implement it.
I thought about it, but came to the conclusion that if there is a need to move the rectangular part of the general canvas, there is an easier way to implement it:
That's not working because my Canvas is the fullscreen. It's like a tick chart but it cost too much time to erase the complete background and construcht and paint everything new so I need to move the content to the left (eg. 8 pixels) and draw only the new 8 pixels (8 px in x direction and full height) with new data. I tried to move the Canvas 8 px to the left with MoveCanvas and this is working but I can't resize it the way that from the left 8 px width are removed and on the right 8 px are added. I hope you understand...