Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1871

 

Hello.

In the robot's code, there are arrows created by the ObjectCreate command. Is it possible to make arrows that are created above/below the price move proportionally away/close to the price when zooming in/out? If I make a small distance - when zooming out the arrows hit the price, if I make a larger distance from the price - when zooming in I have to constantly look for these arrows outside the window...

 
Vladimir Makhnin #:

Vivaldi

found the market via MT

Try downloading via Chrome or Firefox. It should offer a choice of terminal location.

 
AlexandrVV ObjectCreate command. Is it possible to make arrows that are created above/below the price move proportionally away/close to the price when zooming in/out? If I zoom out a little - when zooming out the arrows hit the price, if I zoom in a little - when zooming out I have to constantly look for these arrows outside the window...

As far as I remember, but I may be wrong, it is possible to get the price value in height (in pixels), which means it is possible to do so. But I haven't tested it in practice.

 
Mihail Matkovskij #:

Try downloading via Chrome or Firfox. It should offer a choice of terminal location.

The terminal location is selected during installation. What the installer was downloaded through is irrelevant.

Michael, a big request to you to stop your malicious practice of providing false information.

 
Maksim Emeliashin #:

I join in the question.

Also about enum: If there is EnumToString function, why not StringToEnum - some incredibly complex task there?

Saving enum values in the database as numbers is not an option, because if some new value is added to the enum in the middle, that's it, the data in the database turned into a pumpkin, and they are unreadable as numbers, so you cannot look through them with your eyes.

It is possible to find a constant in enum with the help of brute force function (by the same principle), translating it using EnumToString and comparing with the sought. All that remains is to return the result.

 
x572intraday #:

Thank you. I'll keep it in mind, although it's the in-house method that's missing, as writing your own is just multiplying the code.

The in-house code is also written by someone else and also takes time to execute. The only thing is that it can be more optimized. But in general, if there is no function in MQL, the programmer has everything to write his or her own. And this can't but rejoice.

What's wrong with a lot of code? Save it to a module by creating your own folder in the Include directory and plug it into your applications when needed. By the way, this is another advantage of MQL.
 
AlexandrVV ObjectCreate command. Is it possible to make arrows that are created above/below the price move proportionally away/close to the price when zooming in/out? If I make a small distance - when zooming out the arrows hit the price, if I make a bigger distance from the price - when zooming in I have to constantly look for these arrows outside the window...

Process CHARTEVENT_CHART_CHANGE in the OnChartEvent handler . Divide chart height ChartGetDouble()CHART_PRICE_MAX- CHART_FIXED_MIN by specific number. The obtained value is added to the price or subtracted from it (depending on where the arrow should be up or down). In case of moving or scaling the graph, the obtained value will always be visually the same.

 
Andrey Sokolov #:

The location of the terminal is selected during installation. What the installer was downloaded through does not matter.

Michael, a big request to you to stop your malicious practice of providing false information.

It's only during installation that the location of the program is selected...? Are you serious?!

Andrey Sokolov #:

As far as I remember, but I could be wrong, it is possible to get the price value in height (in pixels), which means it can be done that way. But I haven't tested it in practice.

In this case it makes no sense to translate into pixels.

 
Mihail Matkovskij #:

In this case it makes no sense to convert to pixels.

Possibly, pointed out that I haven't done such a thing in practice, just wondering.

Mihail Matkovskij#:

Only the installation selects the location of the program...? Are you serious?!

Mihail Mat kovskij #:

Try downloading via Chrome or Firefox. It should offer a choice of terminal location.

Then explain the difference which browser the installer is downloaded with?

 
Andrey Sokolov #:

Probably indicated that I haven't done this in practice, just wondering.

What difference does it make which browser the installer is downloaded with?

Then study MQL properly to begin with andgive your advice to everyone.You don't know how to do anything and you don't understand what others write, accusing them of giving supposedly wrong information in your opinion!

P.S. To those who give the right advice you write something like "don't confuse newcomers". But at the same time you confuse everyone.
Reason: