Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1539

 
Jemo2200 #:
I need your help to get started because I am a beginner.

Read.

Программирование на MQL5 для трейдеров - Учебник на MQL5.com
Программирование на MQL5 для трейдеров - Учебник на MQL5.com
  • www.mql5.com
Современный трейдинг немыслим без компьютера. Автоматизация рабочего процесса трейдера уже давно вышла за пределы бирж и офисов брокеров, став...
 
MrBrooklin #:

I will try to figure out what the author of this message needs. If I understood correctly, he wants to get the current market information using the SymbolInfoDouble() function. As the second parameter he specifies an identifier from the ENUM_SYMBOL_INFO_DOUBLE enumeration, namely SYMBOL_PRICE_VOLATILITY, and expects to receive this value from his broker's server. If this is indeed the case, it is not a fact that he can get this value.

I have already encountered a similar question (problem) and it was explained to me on the Forum that a request with the identifier I specified may not always have an answer.

Now I have a counter question for the author of the message - why are you looking for the formula on the MQL5 website and why should it be here and not with the broker, who should provide an answer to the requested information?

Also. Artem is absolutely right when he suggested using the ATR indicator. This will be the simplest solution to the problem.

Regards, Vladimir.

Thank you for your thoughtful answers. Are you saying that SYMBOL_PRICE_VOLATILITY filling depends on the broker? I thought that the spread depends on the broker. But the spread is determined by...

If I'm interested in comparing spread to volatility, how do I compare spread to ATR result? How does volatility relate to ATR? How do I turn ATR into points or percentages of volatility?

 
maxvoronin74 #:

Are you saying that the SYMBOL_PRICE_VOLATILITY filling of SYMBOL_PRICE_VOLATILITY is broker dependent?

Yes.

And if someone else can explain to me that he is absolutely wrong, I will be only grateful.

Regards, Vladimir.

 
maxvoronin74 #:
If I am interested in comparing spread to volatility, how do I compare spread to ATR result? How does volatility relate to ATR? How do you turn ATR into points or percentages of volatility?

Looks like we've gone in a second circle:
  1. Honestly, I too am wondering how one compares spread to volatility? And more importantly, for what purpose?
  2. ATR (average true range) is anindicator of volatility. How else can it relate to volatility? I don't understand what you don't understand.
  3. The ATR indicator has a code with a formula in its calculation part, which is used to draw a corresponding picture. The indicator is just a tool for visualising the formula you are looking for.

I have already written earlier, but let me repeat it again: "Then, what prevents you from opening, for example, the code of theATR indicator and taking this formula from its calculation part?".

Regards, Vladimir.

 
MrBrooklin #:

Looks like we've gone for a second go-round:
  1. Honestly, I too wonder how you can compare spread to volatility? And more importantly, for what purpose?
  2. ATR (average true range) is anindicator of volatility. How else can it relate to volatility? I don't understand what you don't understand.
  3. The ATR indicator has a code with a formula in its calculation part, which is used to draw a corresponding picture. The indicator is just a tool for visualising the formula you are looking for.

I have already written earlier, but let me repeat it again: "Then, what prevents you from opening, for example, the code of theATR indicator and taking this formula from its calculation part?".

Regards, Vladimir.

1. When the volatility is greater than the spread, there is a chance to get out of the loss before the price direction changes.

2. I have already been answered by AI:

"ATR (Average True Range) is a technical indicator that measures price volatility. It is measured in units of price and is commonly used to determine stop loss and take profit levels.

To convert ATR from units of price to percentage of volatility, you can use the following formula:

ATR Percentage = (ATR / Closing Price) * 100

Where:
ATR is the value of Average True Range
Closing Price is the closing price of the asset

This formula allows you to express ATR as a percentage relative to the closing price of the asset. This can help traders compare the volatility of different assets regardless of their prices.

If you want to convert ATR from price units to pips, you don't need to do that, because ATR is already measured in pips."

In general, if I understood correctly, the SYMBOL_PRICE_VOLATILITY parameter should display at least the ATR value provided by the MT5 platform. But instead it displays 0.

If something is wrong, please correct it. And if everything is correct, the question is closed.

 
maxvoronin74 #:

1. When the volatility is greater than the spread, there is a chance to get out of the loss before the price direction changes.

2. The AI has already answered me:

ATR (Average True Range) is a technical indicator that measures price volatility. It is measured in units of price and is commonly used to determine stop loss and take profit levels.

To convert ATR from units of price to percentage of volatility, you can use the following formula:

ATR Percentage = (ATR / Closing Price) * 100

Where:
ATR is the value of Average True Range
Closing Price is the closing price of an asset

This formula allows you to express ATR as a percentage relative to the closing price of an asset. This can help traders compare the volatility of different assets regardless of their prices.

If you need to convert ATR from price units to pips, you do not need to do so, as ATR is already measured in pips.

It is very reasonable to believe an iron that says contradictory information (is it in price or in pips?) than to listen to people who have already said it before.
 
Artyom Trishkin #:
It is very reasonable to believe an iron that says contradictory information (so in price, or in points?) than to immediately listen to people who have already said it before.
What's the difference between "in price" and "in points"? Apparently it's about putting the price into points. But I'm aware of that. I usually use SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_SIZE).
 
maxvoronin74 #:
What's the difference between "in price" and "in points"? Apparently it's about putting the price into points. But I'm aware of that. I usually use SymbolInfoDouble(Symbol(),SYMBOL_TRADE_TICK_SIZE).

TickSize is not a point, it's the minimum price change. A point is Point() - the value of one point.

The price can minimally change by more than one point at a time.

 
Artyom Trishkin #:

The price can minimally change by more than one point at a time.

I didn't know that. Can't imagine why this is the case. Found on the topic: https://www.mql5.com/ru/forum/203707#comment_5264074

 
If the average volatility is given by the ATR indicator, is there any way to represent or modernise ATR so that the period is arbitrary? After all, MT5 does not have periods shorter than a minute.
Reason: