I'm not quite sure what it is you are trying to calculate, but please note that the Tick Value obtained by the "SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE)" is already expressed in your account's deposit currency and does not need to be "converted".
EDIT: Maybe you already know that and I'm just misunderstanding what it is you are trying to achieve. Can you provide more details please so we can better understand the context?
I'm not quite sure what it is you are trying to calculate, but please note that the Tick Value obtained by the "SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE)" is already expressed in your account's deposit currency and does not need to be "converted".
EDIT: Maybe you already know that and I'm just misunderstanding what it is you are trying to achieve. Can you provide more details please so we can better understand the context?
Thanks for your reply. What I want is to have my custom way to calculate SYMBOL_TRADE_TICK_VALUE.
SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE) == MyCustomTickValCalculator(symbol)
As you correctly mentione regular MQL5 function is already used for reference value here (stored in variable 'expected')
My method returns to 'result' var.
I'm getting different values, can't understand why?
Thanks for your reply. What I want is to have my custom way to calculate SYMBOL_TRADE_TICK_VALUE.
SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE) == MyCustomTickValCalculator(symbol)
As you correctly mentione regular MQL5 function is already used for reference value here (stored in variable 'expected')
My method returns to 'result' var.
I'm getting different values, can't understand why?
I've never thought about that, but maybe it has to do with the Spread, namely, maybe it should be Bid/Ask and not Bid/Bid! Just a guess, I'm not actually sure.
I tried all combinations)) no luck
Just did a test with Bid/Ask with your code and the results seem closer:
2021.04.17 23:24:00.544 testtickvalue EURGBP,H1: tickvalue expected: 1.38390000 result: 1.38387794EDIT: In this case of Bid/Ask, the difference might just be rounding of the Tick Value!
Just did a test with Bid/Ask with your code and the results seem closer:
EDIT: In this case of Bid/Ask, the difference might just be rounding of the Tick Value!Updated code for more clearance.
Your result looks good enough to be rounded, but I just ran with Bid/Ask:
2021.04.18 01:32:13.715 test-tick-value-to-forum-question (EURGBP,M15) tickvalue expected: 1.38401 result: 1.383843284013075
.. and it seems mine still not good enough. May be it's a broker. Which one you use?
Just did a test with Bid/Ask with your code and the results seem closer:
EDIT: In this case of Bid/Ask, the difference might just be rounding of the Tick Value!Also I beleave we are talking the same Bid/Ask?
//-my method to calculate TICK_VALUE: const double result = SymbolInfoDouble(base + acc, SYMBOL_BID) / SymbolInfoDouble(symbol, SYMBOL_ASK);
Yes, that is correct! I also tried all the combinations, including with Mid Price, both on MetaTrader 4 and 5 but it is closest on MetaTrader 4 and worse on MetaTrader 5
MetaTrader 5:
2021.04.17 23:42:31.612 testtickvalue (EURGBP,H1) BID/BID - tickvalue expected: 1.38383000 result: 1.38445271 2021.04.17 23:42:31.612 testtickvalue (EURGBP,H1) BID/ASK - tickvalue expected: 1.38383000 result: 1.38371717 2021.04.17 23:42:31.612 testtickvalue (EURGBP,H1) ASK/BID - tickvalue expected: 1.38383000 result: 1.38486873 2021.04.17 23:42:31.612 testtickvalue (EURGBP,H1) ASK/ASK - tickvalue expected: 1.38383000 result: 1.38413296 2021.04.17 23:42:31.612 testtickvalue (EURGBP,H1) MID/MID - tickvalue expected: 1.38383000 result: 1.38429279MetaTrader 4:
2021.04.17 23:46:27.721 testtickvalue EURGBP,H1: BID/BID - tickvalue expected: 1.38390000 result: 1.38445361 2021.04.17 23:46:27.721 testtickvalue EURGBP,H1: BID/ASK - tickvalue expected: 1.38390000 result: 1.38387794 2021.04.17 23:46:27.721 testtickvalue EURGBP,H1: ASK/BID - tickvalue expected: 1.38390000 result: 1.38470783 2021.04.17 23:46:27.721 testtickvalue EURGBP,H1: ASK/ASK - tickvalue expected: 1.38390000 result: 1.38413204 2021.04.17 23:46:27.721 testtickvalue EURGBP,H1: MID/MID - tickvalue expected: 1.38390000 result: 1.38429279
Just did a search and found this: https://www.mql5.com/en/forum/187683
- 2017.03.21
- www.mql5.com
If I follow the logic in your code, you are applying the following logic - Is this correct?
(EUR/USD) / (EUR/GBP) = (EUR/USD) * (GBP/EUR) = GBP/USD
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need to calculate tick value for currecy pair that does not include account currency, but getting different from defult SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE) result.
Can someone please point me on what I'm doing wrong here?
Sample output: