Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Trading varieties - MetaTrader 5 library | Trading script download - MT4/MT5 resources - MetaTrader 5 resources

author EAcpu | 4 reads | 0 comments |

The library contains functions that allow you to learn the basics of working with custom symbols and provides some useful out-of-the-box solutions.

When you run a backtest on a cross currency pair, the tester uses the main symbol and another symbol that allows conversion of the profit currency of the main symbol into the account currency. During a single test run, especially during optimization, accessing additional symbols, generating their quotes and synchronizing them with the main symbol takes up too much valuable computing resources and time. However, this accuracy is almost always unnecessary. Therefore, I want to bypass this interference/deficiency of the MetaTrader 5 tester. This can be done easily in MetaTrader 4, since it offers the possibility to change the account currency directly in the tester. MetaTrader 5 does not offer this option.

The demo script shows an attempt to bypass the tester's limitations by removing unnecessary calculations. To do this, it creates a copy of the symbol for backtesting and sets the profit currency equal to the account currency. Therefore there is no need to convert the test results. In this case, profits are actually calculated in pips, which is very illustrative in some cases.


Attachment download

📎 symbol_example.mq5 (0.69 KB)

📎 symbol.mqh (5.32 KB)

Source: MQL5 #18855

Verification code Refresh