Discussion of article "Visual strategy builder. Creating trading robots without programming" - page 6
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
...
I will add wheel scrolling in future versions....
I would like to share my experience in implementing wheel scrolling. Perhaps my technology will not suit you, but it may give you the right idea (if you haven't decided on the implementation method yet).
Inside the OnChartEvent() function in the condition :
1. I use the ChartNavigate function and set the current chart to the -100 bars back position.
2. I set the number of the first visible bar using ChartGetInteger(0,FIRST_VISIBLE_BAR) to the static variable "First_bar_number".
3. Next, I fix the chart event CHARTEVENT_CHART_CHANGE once through (I use flag "a" and flag "b" for this purpose).
4. I compare "Number_of_the_first_bar" and "Number_of_this_bar" (which I also get via ChartGetInteger(0,FIRST_VISIBLE_BAR), but on each CHARTEVENT_CHART_CHANGE event, not once as with "Number_of_the_first_bar") and determine the direction of the chart shift.
and determine the direction of the chart shift.
5. Next, everything is simple - I move the kanvas image with ObjectSetInteger(0,G_CORE[CANVAS][_NAME],OBJPROP_YOFFSET,G_CORE[CANVAS][_FIELD_TO_VIEW_Y_DISTANCE]); I return the chart to its original position - ChartNavigate(0,CHART_END,-100);
6. I skip the next chart event because it is generated from the called ChartNavigate function . Then everything repeats itself.
Here's the code:
The disadvantage of this method is that the chart in the background twitches. However, your constructor takes up all of the visible part of it and so it won't be noticeable.
The advantage of this method is that you get excellent scrolling with the wheel, not inferior to the scrolling of Windows windows. There is energy, deceleration... Also, when hovering over a horizontal scroll bar and scrolling the wheel, I have a horizontal scroll bar. It's easy to do this.
With this scrolling, users will feel like they are working in windup).
This is what it looks like: https://www.mql5.com/ru/forum/139237/page7
I would like to share my experience in implementing scrolling with the wheel. Perhaps my technology will not suit you, but it may give you the right idea (if you have not yet decided on the method of implementation).
Inside the OnChartEvent() function in the condition :
1. I use the ChartNavigate function and set the current chart to the position -100 bars back.
2. I set the number of the first visible bar using ChartGetInteger(0,FIRST_VISIBLE_BAR) into the static variable "First_bar_number".
3. Next, I fix the chart event CHARTEVENT_CHART_CHANGE once through (I use flag "a" and flag "b" for this purpose).
4. I compare "Number_of_the_first_bar" and "Number_of_this_bar" (which I also get via ChartGetInteger(0,FIRST_VISIBLE_BAR), but on each CHARTEVENT_CHART_CHANGE event, not once as with "Number_of_the_first_bar").
and determine the direction of chart shift.
5. Next, everything is simple - I move the kanvas image with ObjectSetInteger(0,G_CORE[CANVAS][_NAME],OBJPROP_YOFFSET,G_CORE[CANVAS][_FIELD_TO_VIEW_Y_DISTANCE]); I return the chart to its original position - ChartNavigate(0,CHART_END,-100);
6. I skip the next chart event because it is generated from the called ChartNavigate function . Then everything repeats itself.
Here is the code:
The disadvantage of this method is that the chart in the background twitches. However, your constructor occupies the whole visible part of it, so it won't be noticeable.
The advantage of this method is that you get excellent wheel scrolling, not inferior to the scrolling of Windows windows. There is energy, deceleration... Also, when hovering over a horizontal scroll bar and scrolling the wheel, I have a horizontal scroll bar. It is easy to do this.
With this scrolling, users will feel like they're working in windup).
This is what it looks like: https://www.mql5.com/ru/forum/139237/page7
Thanks.
What's wrong with CHARTEVENT_MOUSE_WHEEL?
https://www.mql5.com/en/docs/constants/chartconstants/enum_chartevents
Thank you.
What's wrong with CHARTEVENT_MOUSE_WHEEL?
https://www.mql5.com/en/docs/constants/chartconstants/enum_chartevents
When I did the scrolling with the wheel, it wasn't there yet. So I didn't even try it. (Besides, I'm still working on MT4, and it doesn't seem to be available there).
Does it give energy and deceleration?
When I did the scrolling with the wheel, it wasn't there yet. That's why I didn't even try it. (Besides, I'm still working on MT4, and it doesn't seem to be available there).
Does it give energy and deceleration?
I don't know, I haven't tried it. I just remember that there is such an event.
Good afternoon.
I am the NEOPROGRAMMIST for whom this product and the article about it exist.
I have a question - for educational purposes I tried to reproduce the Expert Advisor from the example number 1 (crossing of fast and slow MA). I did everything as in the article, letter by letter. As a result, the Expert Advisor sometimes opens and immediately closes several positions, instantly creating a loss. And sometimes it opens a single position, all as it should, closes it when the opposite signal arrives. Everything seemed to be good at least with these, but I noticed that they are always only Bai.
The scheme dissolved after rebooting the computer (update at night), so I can not find a possible error, in the code is still too weak, and it is so large and incomprehensible.
Would you be able to review the code and suggest what I did wrong ?
I don't know, I haven't tried it. I just remember that there is such an event.
The event is there, but no one has used it yet).
I would love to get rid of my method because of chart twitching, but MT4 doesn't have this event, and MT5 doesn't know how it works yet....
Good afternoon.
I am the NEOPROGRAMMIST for whom this product and the article about it exists.
I have a question - for educational purposes I tried to reproduce the Expert Advisor from the example number 1 (crossing of fast and slow MA). I did everything as in the article, letter by letter. As a result, the Expert Advisor sometimes opens and immediately closes several positions, instantly creating a loss. And sometimes it opens a single position, all as it should, closes it when the opposite signal arrives. Everything seemed to be good at least with these, but I noticed that they are always only Buy.
The scheme dissolved after rebooting the computer (update at night), so I can not find a possible error, in the code is still too weak, and it is so large and incomprehensible.
Would you be able to review the code and suggest what I did wrong ?
Start by looking at pattern #1. This is exactly the same pattern that is considered in the article (only Travelling and Lossless are added). You can see the parameters of all elements and play with them.
There are a number of errors in your Expert Advisor. One of them is that you have not changed the type of transaction in the element for making sales (it says "purchase" instead of sale).
Start by studying pattern #1. This is exactly the scheme considered in the article (only Travelling and Breakeven are added). You can see the parameters of all elements and play with them.
There are some errors in your Expert Advisor. One of them is that you have not changed the type of transaction in the element for making sales (it says "purchase" instead of sale).
Thank you, I was very pleasantly surprised by the promptness of your reply.
I understand about the unchanged transaction type, it's the reason why only purchases work normally.
But in what place is it wrong that in half a second, apparently on every tick, a whole series of orders is opened and closed at once, and there are both buying and selling orders. ???
Thank you, very pleasantly surprised by the promptness of the response.
I understand about the unchanged transaction type, it is the reason why only purchases work normally.
But in what place is it wrong that in half a second, apparently on every tick, a whole series of orders is opened and immediately closed, and there are both buy and sell orders. ???