[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 238
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
How do I draw a trend channel programmatically?
https://www.mql5.com/ru/code/9734
https://www.mql5.com/ru/code/9734
It turned out to be wrong.
Reworked the script into a separate function. It doesn't want to work.
It can only work as a script that needs to be thrown on the chart in the place where you want it to draw.
And I would like the EA to draw the trend lines itself.
It turned out to be wrong.
Reworked the script into a separate function. It doesn't want to work.
It can only work as a script that needs to be placed on the chart in the place where you want it to draw.
I would like the EA to draw the trend lines itself.
It's not difficult, if you look into the logic of the script. What is going on there? After all, the same should be done in the Expert Advisor. First, we calculate 2 coordinates for setting the line. Second, the trend line is an object. Therefore, in order to set this object on the chart, we need to use the ObjectCreate function. In fact, the MetaEditor's Help should help identify all functions that begin with the word Object - this will eliminate a lot of questions. Take a look here
I don't save objects, lines, channels, shapes and the like as soon as I switch to another timeframe, this was not the case before, and now I have to redraw it again with every switch. I don't know what to do with that, I just do not know how to do it.
I don't save objects, lines, channels, shapes and the like as soon as I switch to another timeframe, this was not the case before, and now I have to redraw it again with every switch. I have no such problems before, now I have to redraw it every time I move to another timeframe.
you have some kind of screwy indicator or expert that cleans all objects.
And how can this be fixed?
It is not difficult, if you look into the logic of the script. What is going on there? Well, the same thing must be done in the Expert Advisor. First, we calculate 2 coordinates for fixing the line. Second, the trend line is an object. Therefore, in order to set this object on the chart, we need to use the ObjectCreate function. In fact, the MetaEditor's Help should help identify all functions that begin with the word Object - this will eliminate a lot of questions. Take a look here
The difficulty is finding the points through which the line will later be drawn.
It is not difficult to draw lines when you can see these points. How do you "see" them programmatically?
It's not hard to draw lines when you see these points. How do you "see" them programmatically?
iHighest and iLowest to help you, and read the ZZ algorithm
ZS:not the easiest task, the code will be small, but the algorithm is complex, I can not find the code, but that's how I searched for a peak at High: High[iHighest(NULL,0,MODE_HIGH,i)