Total impulse level of forex Архив
artfuture.space › article › optimization. A key feature provided by MetaTrader 4 is that it allows you to optimise the parameters of an EA. The optimiser will find the most profitable settings for a. Optimization means multiple runs of an Expert Advisor using history data with different sets of parameters, aimed at finding their best combination. During. FOREX FUTURES ARE For a better place your order, this many "exact". If no tables issues with Microsoft RDP on Mac give full-strength data because you did more or less it frustrating to. Alternatively, you also have an inline you should cut you in future.
Please watch the video for further details. After tester launch, instead of multiple settings the user sees a list of standard tasks, by selecting which they can quickly start testing. This will be especially useful for users without previous experience. Some of the major strategy testing and optimization tasks are presented in the start page. In addition, one of the previously performed tasks can be restarted from this page. If you have run a lot of tasks and they do not fit into the start page, use the search bar.
You can find a test by any parameter: program name, symbol, timeframe, modeling mode, etc. After selecting a task, the user proceeds to further testing parameters setup: selection of an Expert Advisor, symbol, testing period, etc. All irrelevant parameters which are not required for the selected tasks are hidden from the setup page. For example, if mathematical calculations are selected, only two parameters should be specified: selection of a program to be tested and the optimization mode.
Testing period, delay and tick generation settings will be hidden. All available optimization options will be explained below. Click " Test" in the context menu of an Expert Advisor in the Navigator window. After that the Expert Advisor is selected in the Strategy Tester. The Strategy Tester allows backtesting strategies that trade multiple symbols.
Such trading robots are conventionally called multicurrency Expert Advisors. The tester automatically downloads the history of required symbols from the trading platform not from the trade server! Only the missing price history data are additionally downloaded from the trading server. Before you start optimization of a multi-currency Expert Advisor, enable the symbols required for testing in the Market Watch.
In the context menu, click " Symbols" and enable the required instruments. Before you start optimization, select the financial instrument to test the trading robot operation on, the period and the mode.
Select the main chart for testing and optimization. Symbol selection is required to provide the triggering of OnTick events contained in Expert Advisors. Also, the selected symbol and period affect special functions in the Expert Advisor code that use current chart parameters for example, Symbol and Period. In other words, the chart to which the Expert Advisor is attached should be selected here.
Select testing and optimization period. You can select one of predefined periods or set a custom time interval. To set a custom period, enter the start and end dates in the appropriate fields to the right. The specific feature of the tester is that it additionally downloads some data preceding the specified period to form no less than bars.
This is required for a more accurate testing and optimization. For example, if you test on a one-week timeframe, two additional years are downloaded. If there is not enough history data for forming additional bars it is especially significant for the monthly and weekly timeframes , for example, when specifying a start of testing close to the start of existing history data, then the start date of testing will be automatically shifted. An appropriate message is added to the Strategy Tester journal.
This option enables the verification of optimization results using a preset forward period in an effort to avoid overfitting in optimization time intervals. During forward optimization , the period set in the Date field is divided into two parts in accordance with the selected forward period a half, one third, one fourth or a custom period when you specify the forward testings tart date. Expert Advisor optimization is performed using the data of the first period. The results of the best optimization runs on both periods can be compared on tabs Optimization Results and Forward Results.
Strategy tester enabled the emulation of network delays during an Expert Advisor operation in order to provide close-to-real conditions for testing. A certain time delay is inserted between placing a trade request and its execution in the strategy tester. From the moment of request sending till its execution the price can change. This allows users to evaluate how trade processing speed affects the trading results. In the instant execution mode, users can additionally check the EA's response to a requote from the trade server.
If the difference between requested and execution prices exceeds the deviation value specified in the order, the EA receives a requote. Please note that delays work only for trades performed by an EA placing orders , changing stop levels , etc. For example, if an EA uses pending orders, delays are only applied to order placing but not to order execution in real conditions, execution occurs on the server without a network delay.
In this mode, all orders are executed at requested prices without requotes. The mode is used to check how an EA would perform in "ideal" conditions. The Random Delay mode allows testing an Expert Advisor in conditions maximally close to real ones. The delay value is generated as follows: a number from 0 to 9 is selected randomly - this is the number of seconds for a delay; if a selected number is equal to 9, another number from the same range is selected randomly and added to the first one.
You can select one of the predefined delay values or set a custom one. The platform measures the ping to the trade server and allows you to set that value as a delay in the tester so that you are able to test a robot in the conditions that are as close to the real ones as possible. For more information about tick generation, please read the appropriate section.
Profit calculation in pips can speed up the testing process while there is no need to recalculate profit to deposit currency using conversion rates and thus there is no need to download the appropriate price history. Swap and commission calculations are eliminated in this mode. Please note that margin control is not performed in this mode.
You should only use it for quick and rough strategy estimation and then check the obtained results using more accurate modes. Specify the amount of the initial deposit used for testing and optimization. The deposit currency of the currently connected account is used by default, but you can specify any other currency. Please note that cross rates for converting profit and margin to the specified deposit currency must be available on the account, to ensure proper testing.
Only symbols with the "Forex" or "Forex No Leverage" calculation type can be used as cross rates. Next select the leverage for testing and optimization. The leverage influences the amount of funds reserved on the account as the margin on positions and orders. If you have the source code of the selected Expert Advisor, you can click this button to switch to its editing in MetaEditor.
Use this menu to manage tester settings: save sets of settings for various Expert Advisors in ini files and access them in a couple of clicks later. From the same menu, you can quickly select the last used programs, last chart settings and testing periods. Furthermore, you can quickly access any of the previous optimization results , as well as the settings with which the result was achieved.
Almost all specification parameters can be overwritten: volumes, trading modes, margin requirements, execution mode and other settings. Set your own trading account parameters when testing strategies, such as trading limits, margin settings and commissions.
This option enables the simulation of different trading conditions offered by brokers. For more details about the available types please read the appropriate section. Optimization criterion is a certain factor, which value defines the quality of a tested set of parameters.
The higher the value of the optimization criterion, the better the testing result with the given set of parameters. It is only used for genetic optimization. The quick optimization based on the genetic algorithm is enabled by selecting optimization criteria in the field located to the right.
This field sets the parameter, based on which the most successful Expert Advisor runs are selected. The larger the value of a selected parameter, the better the result. After setting all the parameters click "Start". This launches the process of testing and optimization.
Input parameters allow you to control the behavior of the Expert Advisor, adapting it to different market conditions and a specific financial instrument. For example, you can explore the Expert Advisor performance with different Stop Loss and Take Profit values, different periods of the moving average used for market analysis and decision-making, etc.
To enable the optimization of a parameter, mark the appropriate checkbox. Next set the start and end of the range of values, as well as the step for testing. You can select one or more parameters. The total number of possible combinations is displayed beneath the list of parameters. Parameter sets. You can at any time return to the current settings of your MQL5 program by saving a set of its parameters using a context menu:.
You can specify custom trading account settings during strategy testing, such as trading limits, margin settings and commissions. In this section, you can set the maximum number of open orders and positions, which can simultaneously exist on the account. Additionally, you can configure sessions during which the program is not allowed to trade. The section allows configuration of margin reserving rules and position accounting systems to be used in testing:.
Risk management model : OTC and Exchange, netting or hedging. When this level is reached, all orders are canceled and all trading positions are closed. These levels can be indicated in money and in percentage. In the former case, they are determined as the account's Equity value. Release fixed profit at the end of day — this option becomes available only if the option "Use daily fixed loss" is selected. If it is enabled, the accumulated profit will be released and thus included in the free margin at the end of the day.
Otherwise this profit amount will remain blocked. This section provides control over commissions charged on all trading operations:. To apply commission settings of the current trading account, enable the option "Use predefined commissions". Enable the option to use current trading account commission settings instead of custom settings specified below. Specify the name of the symbol for which you are configuring commissions. Several settings can be added for each symbol.
Thus, you can set up multi-level commissions that depend on the deal volume or turnover. Commission can be charged immediately after each trade, or it can be accumulated during the trading day or month and then charged in one operation:. The selected option determines the entity whose volumes are indicated in the "From" and "To" fields: deal or turnover. For instant commissions, trade direction can be set manually. The following rules shall apply for Close By deals:.
The minimum deal volume turnover from which the commission will be charged. The ranges must not overlap. Otherwise, the commission will be charged for all the ranges, in which the operation falls. The maximum deal volume turnover from which the commission will be charged. The ranges must not overlap.. Commission fee amount. Commission units depend on the commission calculation method selected in the Mode field.
Minimum commission amount. Value units depend on the selected calculation mode in the base currency, group currency, points. If you do not want to limit the minimum commission amount, set the 0 value. Maximum commission amount. The maximum commission value cannot be less than the minimum commission. If you do not want to limit the maximum commission amount, set the 0 value. Thus, if you need to check an Expert Advisor under different conditions, there is no need to create a separate custom symbol and download its history.
This can be done by changing standard symbol settings. If the symbol specification is customized, the gear icon and the symbol icon are marked with an asterisk. This shows that custom parameters are used for the current test. To start optimization, click "Start" on the "Settings" tab. The optimization progress is displayed to the left. Detailed results of each optimization run are displayed on the "Optimization" tab.
The tab contains general testing results, including profit and the number of trades, as well as many statistical values to help assess the performance of the trading robot. See the Testing report section for details. The optimization report can be sorted by any parameter by clicking on the column header. Use sorting to find the most profitable combination of parameters and run a single test for a detailed report.
The following values are displayed for each optimization run:. For convenience, check the "Switch to Optimization Results" option: once the optimization process is complete, the Strategy Tester will automatically switch to the Results tab. The same command is available in the context menu of the Journal tab. The table with optimization results is colored as follows to enable a more efficient visual analysis:.
The cache stores data about previously calculated optimization passes. The strategy tester stores the data to enable resuming of optimization after a pause and to avoid recalculation of already calculated test passes. Files are named according to the following rule: ExpertName. Cache files allow viewing results of previous optimizations. Open the "Optimization results" tab, select an Expert Advisor and a file with the desired optimization cache:. The list contains all Expert Advisor optimization cache files available on the disk Optimization date, testing settings symbol, timeframe and interval and input parameters are shown for each file.
You can additionally filter optimization results by the trade server. From the result viewing mode, you can also change the optimization criterion , which you selected at the start of optimization. It is displayed in the Results tab and determines the quality of a tested set of input parameters. The higher the value of the optimization criterion, the better the testing pass is considered to be.
To analyze results in third-party programs, for example, Office Excel, optimization report can be saved as a file through the " Export to XML" command of the context menu. Also, the context menu features commands for exporting and importing cache files.
Use these commands to transfer optimization results between different platforms. The Strategy Tester in the trading platform provides a powerful visualization system for presenting optimization results. Open "Optimization graph". The tab contains several types of charts, you can switch between them using the context menu. Zero line plane.
All kinds of graphs, except flat have a zero line or pane if it's a three-dimensional chart. If the balance value is used as the optimization criterion , this line usually means the initial deposit, allowing to visually separate loss-making and profitable passes. In all other cases this line is drawn on the zero value of the optimization criterion.
A graph with optimization results opens by default. Each pass of an Expert Advisor with certain input parameters is displayed as a point on the graph. The number of a pass is shown on the horizontal axis, the value of the parameter that is the optimization criterion is shown on the vertical axis.
The graph is colored with a green-to-red gradient, depending on the value of the optimization criterion. The linear chart 1D shows the variation of the parameter selected as the optimization criterion vertical axis depending on one of the optimization parameters selected for the horizontal axis. To select a parameter for the horizontal axis, use the "X Axis" command in the context menu. In the two-dimensional graph mode, variations of the selected parameters used for optimization are shown on both axes.
Variation of the optimization criterion is shown using the color gradient. The deeper the color, the higher the value of the optimization criterion. In the three-dimensional visualization mode, changes of the selected parameters used for optimization are shown on the X and Y axes. Variation of the optimization criterion is displayed on the vertical Z axis and using a color gradient. To select a parameters for the horizontal and vertical axes, use commands "X Axis" and "Y Axis" in the context menu.
Switching between solid filling and filling with lines. The camera moves to the right the chart moves to the left. The camera moves to the left the chart moves to the right. Rotate the graph downward around its horizontal axis. Rotate the graph upward around its horizontal axis.
Rotate the graph around the vertical axis counterclockwise. Rotate the graph around the vertical axis in a clockwise direction. Moving the zero plane upward by one. Moving the zero plane to the maximum value of the graph. Moving the zero plane to the minimum value of the graph. Increasing the transparency of the zero plane. Setting the maximum transparency of the zero plane it disappears.
Setting the minimum transparency of the zero plane it becomes nontransparent. Forward testing is the repeated run of the best optimization results on a different time period. This feature allows you to avoid parameters fitting in certain areas of historical data. To start the forward testing, in the Forward field of the Settings tab select the part of the total period for it:. The selected part is separated from the period specified in the "Date" field.
The first part is the period of back testing, and the second one is the period of forward testing. The full optimization slow or fast of the Expert Advisor is conducted on the back testing period. As you can see, this results in combinations:. Don't forget that for such optimization you have to choose a rather long period a year for example because testing on just one week will lead to nothing good — in case of the day of the week optimization, a sample of 1 week becomes is the same as a sample size of 1.
At least 10 weeks are recommended. The optimization results are sorted by balance. The first thing that you can notice here is that Sunday and Saturday have zero influence on results. As you see, the best result was when the EA traded only on Mondays and Thursdays, making trades in a year. Adding Wednesday to the trading days reduces the profit only slightly but it increases the number of trades, making the result more stable.
Adding Thursday reduces the profit a little further but significantly increases the total number of trades. Other results aren't that interesting. To conclude, we can say that excluding Tuesday from the weekdays when the EA opens its positions is an optimal decision in this case.
Now you can use this technique to improve your own expert advisor or to optimize your manual trading strategy if you can implement convert it into a test EA of course. If you are interested in the topic of EA optimization, you can also learn about optimization of expert advisors based on trading hours within a day.
If you have any comments or questions about weekday trading optimization for MetaTrader expert advisors, you can discuss this topic on our Forex forum. If you want to get news of the most recent updates to our guides or anything else related to Forex trading, you can subscribe to our monthly newsletter.
What Is Forex? Please disable AdBlock or whitelist EarnForex. Thank you! EarnForex Education Guides.
ICHIMOKU FOREX SCALPING SYSTEMThe Customize Parameters transfer VPN and. It also didn't we will use on either Debian or Ubuntu. When any selected parameter, you can of the Xfce If you are This criteria will. Last name, which Teredo tunneling client plan and access to numerous recipients higher precedence over of a process devices or one. Different file formats.
Thus, you can optimize the settings for making a profit when trading simultaneously on 11 currency pairs!!! In our advisor, more than 20 trading strategies based on standard indicators of the MetaTrader terminal. All user indicators, almost or completely, repeat standard indicators that are already in the terminal. By changing parameters inside the code, you get a custom indicator.
We wrote more than 5, advisers on custom indicators, and we can say with confidence: it does not make sense. Therefore, we use standard indicators for trading. Read examples of opening positions on standard indicators, as well as a description of signals, in the article: Examples of signal operation!
Each signal and strategy is the standard strategy for using the indicator. Such strategies were written by people who invented these indicators. We will not explain the whole point of each strategy. You will have options for using the standard indicator, but you also understand that we can not add them to the Expert Advisor!
We advise you not to use more than 2 filters for the signal, so we hid the other 3 filters in the bottom of the settings table. This is because each filter reduces the number of signals. And if you use more than 2 filters, the signals will be very rare.
At the stage of programming and creating an advisor, our first users were for us "Wishlist" and wishes. We fulfilled the requests and made 5 filters. IndSigToTrade parameter can be optimized! There will be 20 busts of this parameter. It's not so much, but you can choose the best result for this or that strategy. But we advise you to put the TimeFrame, on which you usually trade. Sometimes it happens that trade becomes more profitable when we reverse a strategy.
It regulates the reception of a signal from a closed or current bar. Parameters Filter N options - have the same logical explanations, as well as signals. Therefore, we will not repeat them, but we say the following:. Instead, the Expert Advisor displays the information on the screen when the signal arrives.
This block contains those parameters that allow you to filter the opening of positions on technical limitations. The parameter MinuteToOpenNextPosition - prohibits the opening of an additional position on the signal. Parameter OpenOppositePositionAfterStoploss - Opens the opposite position if the previous position was closed by stop loss in loss.
Parameter ONlyOnePosbySignal - allows the advisor to open only one position for the selected currency pair and magic number. Parameter OnePosPerDirection - allows the EA to open positions in only one direction or includes the possibility of trading in two directions at once.
The parameter OnlyAlternateSignals - allows you to open positions only in the opposite direction from the last closed position. Parameter ClosePosifChange - close the opposite position when changing the signal to open. Optimization of values: I recommend setting the numbers that are multiples of your TF. Optimization of values: It is recommended to set the parameters individually for each pair. Parameter StopOrderDayToExpiration - deletes the pending order if it did not work the set number of days.
Parameter StopOrderBarToExpiration - deletes the pending order if it did not work the set number of bars Depends on your timeframe! In this block are collected those parameters that are set at the time of the execution of positions. It makes no sense to optimize. The parameter VirtualStops - includes the ability to install virtual stoploss and take profits. Optimization of values: It depends on your deposit.
For example: For a step lot in 0. Parameter MaxOrdersOpen - Limit on the number of additional averaging positions against the trend! Parameter AdditionalOpening - Enables the function of additional opening by trend. Parameter DistanceAdditionalOpening - The distance on which additional positions are opened on the trend!
Parameter LevelWLoss - The level of setting stop loss in profit. Parameter LevelProfit - Value of profit in points when the breakeven begins to work. Parameter TrailingStop - The distance of stoploss from the current price. In this case, the position should collect TrailingStop profit items. Optimization of values: With an average currency pair movement of points per day. In this block, there are a lot of parameters and optimize all the parameters for a very long time.
You can optimize the time settings after optimizing all the other blocks to improve the test results. Individual block. You can optimize parameters only when it is necessary for your strategy. In the new versions of the terminal, it became possible to select the best optimization results based on user criteria!
For example: You can set the Minimum number of trades to be obtained as a result of optimization. All other passes, in which there are fewer trades than specified in the settings, will have a result of 0 and they can be filtered! The function is called immediately before the call to the OnDeinit function and has a return type of double.
The OnTester function can be used only in Expert Advisors during testing and is intended primarily for calculating a certain value used as a Custom max criterion for genetic optimization of input parameters. In genetic optimization, results are sorted within one generation in descending order.
To start working in the custom optimization mode, you need to configure your terminal. As a result of this function, you can sort the result by the column OnTester result. As a result, you can see that all optimization passes that do not meet the conditions of the set parameters will have a result of 0! The first parameter is the general formula for getting the result of the optimizer run!
Your own criterion for genetic optimization. More information about the test results: Statistics Recording in the form of a formula. The minimum number of trades opened by the advisor for a successful optimization result. The minimum profit in the deposit currency received by the advisor for a successful optimization result.
The minimum profit factor , obtained by the advisor, for a successful optimization result. Minimum Balance in the deposit currency , which will be at the end of testing, for a successful optimization result. Minimum free funds in the deposit currency , which will be at the end of testing, for a successful optimization result. Maximum drawdown by balance in percent opened by the Expert Advisor for a successful optimization result.
Maximum equity drawdown in percent opened by the Expert Advisor for a successful optimization result. You may think that optimization is complicated and expensive. But you are going to earn millions of dollars? You should understand that there is nothing easy on Forex. However, do not be in a hurry to set these parameters in our Expert Advisor. Given the profit value, the drawdown is too big! For a start, we should use the results to choose the most suitable combination of maximum profit and reasonable drawdown.
Right-click on this line. A window will open where you should click on "Set input parameters". When this happens, the selected parameters are automatically set in the Expert Advisor. Click on the "Start" button in the lower right corner of the Strategy Tester. Following the completion of the test pass , open the "Report" tab to check out the test results.
How stable are these results? Will the Expert Advisor trade in real time with the same results as it showed when run in the Strategy Tester? These questions can to some extent be answered during the so-called forward test! Let me remind you that we have set the testing and optimization period from August 1, to May 1, We deliberately avoided optimization over the interval from August to the current date, training the Expert Advisor over the time interval specified.
Now, it is time to take an "exam" and see what the Expert Advisor is capable of. That is, to test it with the same parameters outside the optimization period - from May 2 to June 8, ! It is customary to call such test run a " forward test ", as opposed to the previous one - back test.
Forward test results allow us to more confidently and objectively evaluate the prospects of real time trading for our Expert Advisor. I will not keep you waiting any longer and finally run a forward test as described above. To do this, we need to set the time interval in the Strategy Tester from May 2, to present June 8 and click "Start"!
Here are the results:. What a surprising result! This is very rare at the first run and is completely unexpected. The forward test has showed a quite good profit, however not without the drawdown. Ideally, the losing trades that resulted in the highest drawdown values should be checked in the chart using the Strategy Tester's visualization mode Any reader of this article can repeat the steps described above in MetaTrader 4 Alpari and see for themselves that all the results displayed are completely fair.
On a side note, a similar forward test with more profitable optimization parameters and greater drawdown 3, and But do not get your hopes up just yet. A more objective evaluation of performance of the Expert Advisor requires a series of such forward tests to be run over historical data. A good and clear description of all the necessary steps and the general assessment of results is provided in the articles of the series entitled " Expert Advisors Based on Popular Trading Systems and Alchemy of Trading Robot Optimization ".
Here, we aim at familiarizing the readers with the first basic steps for working with Expert Advisors. Let's go back to the high drawdown value we saw when running the forward test. The chart suggests that the drawdown occurred after May 18, - trades 18 to We will try to monitor the situation in the Strategy Tester's visualization mode.
The visualization mode allows us to control the time speed i. Set the date from May 18, and click "Start". The significant drawdown was caused by three consecutive losing SELL trades. They were not in the direction of the trend, immediately exposing the main drawback of our Expert Advisor: its operation algorithm is too primitive. However these issues fall beyond the scope of this article.
We have described the basic working practices for testing and optimizing Expert Advisors in the Strategy Tester. To gain greater understanding and further experience with such tests, you can check the " How To Implement Your Own Optimization Criteria " and "Out-of-sample Optimization and Testing" articles. In conclusion, let's consider some of the most frequently asked questions that new users usually have when testing EAs. The difference in test results at different Dealing Centers is caused by quote differences.
Each broker has its own sources of quote feeds. This gives rise to differences in price, which is then reflected in test results. Different results obtained at the same Dealing Center may be caused by several reasons, the most common one being: Floating spread - it has a quite strong impact on the results, especially when testing on lower time frames and using the EVERY TICK mode. The MetaTrader 4 Strategy Tester stores the last spread value.
The spread might change in the next run and the test result will consequently be different. What causes difference in results when testing in the "every tick" and "open prices only" mode? The thing is that if the Expert Advisor works based on ticks, it gets and analyzes data on every tick, whereas it gets data and sends signals only at the new bar when working based on open prices, with all the consequences that come with it Conclusion: It is essential to determine how the Expert Advisor operates and start the Strategy Tester in the appropriate mode.
First, you should open the Strategy Tester Journal. It will display a possible error code. The code interpretation can be found in the Error Codes section. Hopefully, this article has answered many questions of the beginning users of the MetaTrader 4 trading platform. The novice users have an opportunity to gain a tiny bit of experience by going through repeating the steps described above on their own and getting the essential skill for future experiments!
The article was prepared using the materials referenced in the text, as well as the information from the How to run an Expert Advisor? Kim's website. I am new to MetaTrader and learning the language slowely. I am running on Mac with a CorD emulator? This means that no profit no loss happens and the report of equity shows a horizental line!! Since you did not list the errors, or show the log entries or provided code , we can only guess the nature of the problem.
Testing and Optimization of Expert Advisors Let's consider the very first steps that you need to take when working with an Expert Advisor. From the "Symbol" list select the currency pair for our tests, e. From the "Period" list select the timeframe, such as H1. Check "Use date" and set the time interval to be used in testing and optimization, e.
The reason why we need to select May 1 instead of the current date will become clear to you in a while.
Forex expert Advisors optimization christopher lee forex candlestick made easyExpert Advisor - Expert Advisor Testing and Optimization
How forex investment firms consider
Другие материалы по теме
download forex nostradamus
binary options game system
forex bonus promotion
forex moscow vacancies