Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 740
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
Do initialisation of variables in OnInit (including redrawing objects)
Explain what this is about.
I added it to OnInit after creating a label
But the result is the same.
Explain what this is about.
I added it to OnInit after creating the tag
but the result is the same.
need to see the code, what's there...
ps. the code above works fine (I don't see any glitches)
(https://www.mql5.com/ru/forum/160683/page739#comment_10290585)
oops. although i replaced the Bid variable with Bid0
Good afternoon, how do I write the order to be opened when the price touches a muvingian?
I have to look at the code to see what's there...
psst. The code above works fine (no glitches)
(https://www.mql5.com/ru/forum/160683/page739#comment_10290585)
oops. although I replaced the Bid variable with Bid0
Forgot to add that this is me testing in 5. In MT4 the vertical marker does move quickly into place when you open the chart, no need to wait for a tick or move the mouse. A few times there were glitches with horizontal shift, managed to overcome only by recompiling the indicator.
Tried it, you have to move the mouse to get the mark back. It's the same crutch, but in a different hand :-)
And switching between charts forCHARTEVENT_CHART_CHANGE is not an event.
Can anyone think of a way to overcome this anomaly?
Print displays a message to me if I switch a chart window, both forwards and backwards switching (I'm on MT4, but it's not written in MT4 docs that chart switching can be caught as aCHARTEVENT_CHART_CHANGE event )
But yes, it's still a crutch method. We need to find out why the Y coordinate is different when switching to another chart. But looking at the code, we can conclude that theChartTimePriceToXY gives different results for some reason.
I forgot to add that I'm testing this in 5. In MT4 the vertical marker really moves quickly into place when the chart is opened, no need to wait for a tick or move the mouse. A few times there were glitches with horizontal shift, managed to overcome only by recompiling the indicator.
Well, in Five there are a lot of "features" - from the queue on the chart to the creation of bars from the minutes, and the triggering of the previous deinit after the current one)
So you need to check the bars/graph/objects - at what point an error occurs and correct it.
in general - you need to check the bars/graphics/objects - at what point an error occurs and correct it.
How to do this, where to start?
How to do it, where to start?
do a print everywhere, i.e. we print the bid (you can also print the current date) in oninit and then in the calculation as well...
I can telepathise that the story does not build up immediately and the bars appear later
do a print everywhere, i.e. in oninit print the bid (you can also print the current date) and then when calculating too...
I telepathize that this story does not have time to build immediately and the bars appear later
For the next code, a story in pictures:
Disconnected the network, adding an indicator
I switch to the next chart
y2 changed value, I go back
y2 has returned its value, but the marker is counted by the "gone" value! I spin the mouse wheel.
The marker is back in its place!