AIS Optimal Stop Levels
- 유틸리티
- Aleksej Poljakov
- 버전: 1.0
Choosing the levels of StopLoss and TakeProfit can have a very strong impact on the overall performance of trading. In addition to the obvious parameters of a trade transaction - the size of a possible win or probable loss - the levels of StopLoss and TakeProfit also affect the expected duration of the transaction, and the profitability of trading in general.
If you have already determined the optimal transaction duration using the “AIS-ODT” script, then you can begin to determine the parameters associated with the StopLoss and TakeProfit levels.
To do this, we proceed as follows. First, we will determine all possible price deviations in one direction or another, and calculate the probabilities of achieving them within a certain time. After that, you can calculate the most optimal levels of StopLoss and TakeProfit, given their size, probability and expected value of profit.
To do this, run the script on the chart of the currency pair of interest and the desired timeframe. Using the ILB parameter in the properties window, set the desired duration of the trading position, expressed in the number of bars. During the work of the utility, data on the entire history is analyzed, and the most optimal values are selected. At the end of the script, two files are formed - “Buy.csv” and “Sell.csv”, containing tables with the results obtained - Figure 1.
In the first column of the table, the possible TakeProfit size is indicated, in the second, the best StopLoss size. The third column shows the probability of winning with these parameters in percent, the fourth indicates the expected profit in a transaction, expressed in points. The fifth column of the table contains an integral indicator of efficiency, which you should be guided by when choosing the StopLoss and TakeProfit levels - the bigger the better.
As can be seen in Figure 2, there is always an optimal ratio, adhering to which we can hope to get the best results in trade.