당사 팬 페이지에 가입하십시오
- 조회수:
- 6030
- 평가:
- 게시됨:
- 2017.11.03 12:22
- 업데이트됨:
- 2018.08.30 12:57
-
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
The library contains functionality that allows you to understand the basics of work with custom symbols, and offers some ready-made solutions that can be useful.
Example
When you run backtest on cross pairs, the tester uses the main symbol and an additional one allowing to convert the profit currency of the main symbol to the account currency. Access to the additional symbol, generation of its ticks, and synchronization with the main symbol take too much precious computing resources and time during a single test run and especially during optimization. However, this accuracy is almost always unnecessary. Therefore, I wanted to bypass this obtrusiveness/flaw of the MetaTrader 5 tester. It can be easily done in MetaTrader 4, because it provides the possibility to change the account currency directly in the tester. MetaTrader 5 does not provide this option.
The demo script shows an attempt to bypass this restriction of the tester, i.e. to remove unnecessary calculations. For this purpose, it creates a copy of the symbol for backtesting, and the sets profit currency equal to the account currency. Therefore conversion of testing results is not required. In this case, profit is actually calculated in pips, which can be very demonstrative in some situations.
// Creating a copy of the symbol and changing the profit currency #property script_show_inputs #include <Symbol.mqh> sinput string PostFix = "_custom"; void OnStart() { const SYMBOL Symb(_Symbol + PostFix); // Creating the symbol Symb = _Symbol; // Copying all properties and the bar history of the main symbol Symb.SetProperty(SYMBOL_CURRENCY_PROFIT, AccountInfoString(ACCOUNT_CURRENCY)); // Making the base currency equal to the deposit currency Symb.On(); // Enabling the symbol in Market Watch ChartOpen(Symb.Name, PERIOD_CURRENT); // Opening the chart of the new symbol }
MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/18855
![ATRValues](https://c.mql5.com/i/code/indicator.png)
The indicator shows a text block with the values of the user defined ATR period for each timeframe.
![KoliErBands](https://c.mql5.com/i/code/indicator.png)
Another version of Bollinger Bands using as the middle line the average of the High and Low over a selected period.
![Last ZZ50](https://c.mql5.com/i/code/expert.png)
The strategy is based on the ZigZag indicator and pending orders.
![Four_MA_Strength_HTF](https://c.mql5.com/i/code/indicator.png)
The Four_MA_Strength indicator with the timeframe selection option available in input parameters.