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
Try this code to calculate the tick_value:
There are several bugs :
1st run (EURCHF not in Market watch)
2021.04.18 12:10:52.579 367457 (AUDCHF,H1) CheckMarketWatch: Unknown symbol 'CHFEUR'
2021.04.18 12:10:52.579 367457 (AUDCHF,H1) CrossRate: Error, cannot get cross rate for CHFEUR
2021.04.18 12:10:52.579 367457 (AUDCHF,H1) GetTickValue: Error, cannot get tick value for AUDCHF
2021.04.18 12:10:52.579 367457 (AUDCHF,H1) AUDCHF tickvalue expected: 0.9070328392101118 result: 0.0
2021.04.18 12:10:52.579 367457 (AUDCHF,H1) AUDCHF test failed! Account currency : EUR Tick size : 1e-05 Contract size : 100000.0 Rate : 0.0
2nd run
2021.04.18 12:11:03.888 367457 (AUDCHF,H1) CheckMarketWatch: Unknown symbol 'CHFEUR'
2021.04.18 12:11:03.888 367457 (AUDCHF,H1) AUDCHF tickvalue expected: 0.9070706154474127 result: 0.9073092835885896
2021.04.18 12:11:03.888 367457 (AUDCHF,H1) AUDCHF test failed! Account currency : EUR Tick size : 1e-05 Contract size : 100000.0 Rate : 0.9073092835885896
Clue : sometimes you need to use Ask and not Bid price.
And the above code is potentially a bug.
Here is another version of the code with corrections as per Alain:
By the way:
https://www.mql5.com/en/forum/365781/
By the way:
https://www.mql5.com/en/forum/365781/
0 answers.
Try this code to calculate the tick_value: