Today we will talk about how to properly set up (optimize) the advisor BuySellProf_Security for profitable and secure trading with a small drawdown. In the beginning, we will carry out the general operations on tuning.
First of all, it is necessary to optimize the adviser. To do this, check the history of quotes for the currency pair of your broker's terminal (they often do not place the trading history to facilitate loading the terminal, and without an expert, the adviser can not begin testing). Quotations can be downloaded manually in the quotes archive (F2). If there is no possibility to pump up the history of trading for a couple of months, then look for them on the Internet or change the broker.
And now it is more detailed. Go to the Tools -> Options tab, then select the "Charts" tab and in the "Max. Bars of history "and" Max. Bars in the window "select the value 250,000 as shown in the figure
(By default, there are 65,000 bars).
Now proceed to optimize the Expert Advisor to select the input parameters.
Open the strategy tester, choose the advisor BuySellProf_Security as shown in the figure,
next, we set the symbol (currency pair), the testing model and the testing period (usually a minimum of two or three months) or choose a period with increased volatility (news output, etc.).
In order for quotes for the required pair to be available in the terminal, to conduct a test on them, open the Tools tab -> Archiveof quotes or press F2. Next, choose the desired pair and period M1 and press the "download" button. After a while, quotes will be downloaded. We overload the terminal (turn it off and turn it on again). Repeat this procedure several times until the gray battery displayed before the period turns yellow-green. And so do all the timeframes.
In order for history center for the required pair to be available in the terminal, to conduct a test on them, open the Tools tab -> Archive of quotes or press F2. Next, choose the desired pair and period M1 and press the "download" button. After a while, history center will be downloaded. We overload the terminal (turn it off and turn it on again). Repeat this procedure several times until the gray battery displayed before the period turns yellow-green. And so do all the timeframes.
With optimization for all ticks, the amount of generated ticks can be quite large, so the terminal can consume quite a lot of resources and a lot of time, which is why it is first necessary to find approximate input parameters for opening prices.
For the final optimization, the Expert Advisor always chooses the method of all ticks. This is the slowest, but also the most reliable method.
To speed up testing in tabs
"Input parameters" first select three or four parameters, check the box and do not forget to set the start parameters, step and stop (the larger the step, the faster the testing will be, but the accuracy of the parameters will be coarser).
In the tabs "Testing" you can enter the deposit used for the test and the deposit currency, as well as the optimized parameter.
Spread - you can specify any value or use the current spread on a pair.
Put a tick in the window "Optimization" and press "Start". After a while, after testing the Expert Advisor, the tester will give you the options of input parameters that you can select in the "Optimization Results" box at your discretion. Choose always parameters with low drawdown and reasonable profit, for this, left-click twice in the "Drawdown" column in the "Optimization results" window.
Setting up EA directly for work
For the correct operation of the BuySellProf_Security advisor, first of all, you need to configure Risk Manager, set your account number in the "Input parameters" field NumberAccount, on which the expert will work. Otherwise, there will be an inscription on the chart and no expert will work.
This inscription appears also when you go to another account. In order to avoid fortuity, I advise you to install EA on the VPS server and do not jump from account to account with one broker.
If the account is correct (the number entered is equal to NumberAccount), EA, with a new tick, displays all parameters or parameters that you entered by default (the default parameters are not working and are selected arbitrarily).
If everything is configured correctly and EA is turned on, then immediately, its work will begin, setting two orders for Buy and for Sell, displaying new data on the computer screen (on the graph) in real time.
Setting the desired profit EA
In the TotalProfitPercentage line - the total percentage of profit, set the desired value in numerical value, to which EA will work tirelessly, you can always change it. After reaching this value, the Expert Advisor will close all available orders, including those set manually and remove itself from the currency pair chart window, thereby completing the work. In this way, you will be notified by the inscription on the chart.
Brokers will not give you bankroll with open and pending orders.If you wish to continue the work of the Expert Advisor, install it on a new schedule in a new window of the currency pair. Then enter the input parameters again.
Setting the way to close the EA orders
By numerous requests, the possibility of closing EA orders in a cycle before closing on the general profit of the orders collected earlier was introduced. Now the Expert Advisor will close all orders in the cycle by CurrentPercentProfit - the current profit in the cycle, this percentage works in the range of 0.1-10%, for large values, EA will close the orders in the cycle for the total profit. I strongly recommend that you optimize the Expert Advisor with this parameter. For how it significantly affects the profit and drawdown of EA, for each currency pair and a certain value of TP, see the work schedules of BuySellProf_Security for different values of CurrentPercentProfit.
Setting the allowable EA drawdown
In order to save your funds and protect against erroneous input parameters, as well as force majeure news, I recommend turning on UsePercentLoss option - enable / disable acceptable drawdown, false - then off, true - means enabled. On the graph, false = 0, true = 1 will be displayed. Now, in the PercentLoss column - the allowable loss percentage (drawdown), enter the acceptable drawdown as a percentage of the balance, for example, PercentLoss = 30. You can also now get the input parameters in the strategy tester, with different PercentLoss indicators. The only recommendation, do not rely on PercentLoss in the testing process, as the main parameter in the trading strategy. By how the tester will give out parameters for the survivability of the advisor, and not for profitable trade. Not to mention the fact that in real trading, the adviser, upon reaching the declared drawdown, removes himself and all orders from the schedule. In this case, you will be notified by an inscription on the chart.
And as a consequence, it will not be able to trade any more, and the strategy tester shows a theoretical possibility, the development of the situation with certain parameters. Therefore, choose parameters in the strategy tester with a low drawdown of not a large PercentLoss for example, PercentLoss = 15-30% and reasonable profit. In real trading, you can put it by anyone, as well as change at any time.
By the way, all input parameters can and should be periodically changed to a greater or lesser extent at least once a month, especially when the seasons change or important news approaches. This will allow the adviser to adapt more quickly and without losses to the realities of the market.
A successful, safe and profitable trade advisor BuySellProf_Security!