Is there an universal solution for Tick value?

 

I wonder how you manage  the Tick value in your code. For some Symbols it is in the deposit currency but for some Symbols it is in another currency. In my opinion it depends on the value of MARGINCALCMODE. If it is 0 (Forex) the Tick value is in the deposit currency. If the MARGINCALCMODE is 1 (CFD) or 3 (CFD for indices) the Tick value is in the base currency. My broker doesn't offer any Symbols where it is 2 (Futures) and for this reason I can't say in which currency is the Tick value in this case.

For example my deposit currency is CZK (Czech Crown). The Tick value e.g. for EURUSD (Forex) is in CZK. The Tick value for DAX (CFD for indices) as well as Crude Oil (CFD) isn't in the deposit currency but in EUR (DAX) and in USD (Crude Oil). In this case I have to calculate the Tick value by EURCZK or USDCZK. But I have to enable these currency pairs to be able work with them. Because my broker doesn't offer e.g. JPYCZK I have to use USDCZK and USDJPY together if I want to know the Tick value for NIKKEI in the deposit currency.

  1. Is there a simpler solution?
  2. Have you had experience with the MARGINCALCMODE=2 (Futures)?
  3. Are my above ideas valid in general?
 
Petr Nosek: For some Symbols it is in the deposit currency but for some Symbols it is in another currency.

In MT4

MODE_TICKVALUE 16 Tick value in the deposit currency

It's the account currency always, not sometimes.  There can't be any solution for sometimes. Verify and complain to your broker if it's not.

<Off topic content removed by moderator>
 
whroeder1:

In MT4

MODE_TICKVALUE 16 Tick value in the deposit currency

It's the account currency always, not sometimes.  There can't be any solution for sometimes. Verify and complain to your broker if it's not.

You are really wrong. The documentation says the Tick value is in the deposit currency but it is not true. You can believe me ;-) Or you can try it. Have a look in attached files.

 
Petr Nosek:

I wonder how you manage  the Tick value in your code. For some Symbols it is in the deposit currency but for some Symbols it is in another currency. In my opinion it depends on the value of MARGINCALCMODE. If it is 0 (Forex) the Tick value is in the deposit currency. If the MARGINCALCMODE is 1 (CFD) or 3 (CFD for indices) the Tick value is in the base currency. My broker doesn't offer any Symbols where it is 2 (Futures) and for this reason I can't say in which currency is the Tick value in this case.

For example my deposit currency is CZK (Czech Crown). The Tick value e.g. for EURUSD (Forex) is in CZK. The Tick value for DAX (CFD for indices) as well as Crude Oil (CFD) isn't in the deposit currency but in EUR (DAX) and in USD (Crude Oil). In this case I have to calculate the Tick value by EURCZK or USDCZK. But I have to enable these currency pairs to be able work with them. Because my broker doesn't offer e.g. JPYCZK I have to use USDCZK and USDJPY together if I want to know the Tick value for NIKKEI in the deposit currency.

  1. Is there a simpler solution?
  2. Have you had experience with the MARGINCALCMODE=2 (Futures)?
  3. Are my above ideas valid in general?

Must always be deposit currency.

However it's set by the broker and is not rare they provide wrong values, mainly for CFDs.

There is not Futures for MT4

Yes your way is right if you have to calculate it yourself.
 
Alain Verleyen:

Must always be deposit currency.

However it's set by the broker and is not rare they provide wrong values, mainly for CFDs.

There is not Futures for MT4

Yes your way is right if you have to calculate it yourself.

Thank you for your confirmation about Futures.

I wrote code which calculate it and in my case it works well, but I don't know if the ideas are universal.

 
If you are interested in finding out if the Tick Value is in an account currency (as MQL4 documentation promises) or in a margin currency you can try my own solution (see: https://www.mql5.com/en/forum/271388/page2#comment_8372541 ) that provides not only the Tick Value Currency but also a Leverage for the symbol. It works for me perfectly but it isn't a general solution.
Leverage for each symbol
Leverage for each symbol
  • 2018.08.12
  • www.mql5.com
I know it isn't a new problem but with new ESMA rules (about leverages) it became "interesting" for me...
 
Petr Nosek:

I wonder how you manage  the Tick value in your code. For some Symbols it is in the deposit currency but for some Symbols it is in another currency. In my opinion it depends on the value of MARGINCALCMODE. If it is 0 (Forex) the Tick value is in the deposit currency. If the MARGINCALCMODE is 1 (CFD) or 3 (CFD for indices) the Tick value is in the base currency. My broker doesn't offer any Symbols where it is 2 (Futures) and for this reason I can't say in which currency is the Tick value in this case.

For example my deposit currency is CZK (Czech Crown). The Tick value e.g. for EURUSD (Forex) is in CZK. The Tick value for DAX (CFD for indices) as well as Crude Oil (CFD) isn't in the deposit currency but in EUR (DAX) and in USD (Crude Oil). In this case I have to calculate the Tick value by EURCZK or USDCZK. But I have to enable these currency pairs to be able work with them. Because my broker doesn't offer e.g. JPYCZK I have to use USDCZK and USDJPY together if I want to know the Tick value for NIKKEI in the deposit currency.

  1. Is there a simpler solution?
  2. Have you had experience with the MARGINCALCMODE=2 (Futures)?
  3. Are my above ideas valid in general?

Use This code (MT5):

***

 
Mohammad Sarzare #:

Use This code (MT5):

***

Please, insert code correctly: when editing a post, click   Code and paste your code in the popup window
MQL5.community - User Memo
MQL5.community - User Memo
  • www.mql5.com
You have just registered and most likely you have questions such as, "How do I insert a picture to my a message?" "How do I format my MQL5 source code?" "Where are my personal messages kept?" You may have many other questions. In this article, we have prepared some hands-on tips that will help you get accustomed in MQL5.community and take full advantage of its available features.