Maximal curves forex

When entering the market, among all the currency pairs we need to choose one with highest trading activity, i. In addition, it is better to trade during the day, when the activity is higher, and to wait out the night. Purely day trading will increase your chances of winning the lottery, but will stretch the working time of Expert Advisor almost two times.

The Deception of Using SL/TP as Proxy Risk-Reward

Which is better - greater chances of winning or shorter time - is up to user to decide. As discussed above, you can trade virtually every minute, but in so doing the chances of winning will become very scanty. On the other hand, we also can't trade for years in order to maximize the probability of winning. This is a typical example of how difficult is to compose requirements specification for writing an Expert Advisor.

Figure 5.


  • wh selfinvest trading signals.
  • Evaluating Forex Strategy Effectiveness Using Sharpe Ratio.
  • Position Sizing Part 6 – The Kelly Criterion! How To Find Your Optimum Risk In Forex!?
  • Forex Take Profit: Learning Material and Sample Indicator.
  • How to Place Stop Losses and Take Profits Using a Maximal Strategy.
  • forex exchange ernakulam.
  • the best forex chart software;

Figure 6. An idea for future use: if indicator market activity begins to increase above its average value, then close profitable positions and leave the unprofitable ones - the market is changing. If indicator falls below its average, then leave profitable positions and close the unprofitable ones - in nearest future market won't change. But this idea requires a separate study.

Implementation of well developed algorithm in the MQL5 language requires technical skills.

You can find the EA code with comments in attachment to this article lottery. Optimization of Expert Advisors, proposed in the MetaTrader 5 client terminal, does not suit us. Indeed, during optimization we need to maximize the probability of winning the lottery. Running EA manually on pieces of history is boring, so we will go another way.

Of course, this is not the same as different pieces of history, but very similar. To do this, select the Slow complete algorithm of optimization by two parameters: the time T and the number of lucky ticket, i. Figure 7. Probability of winning the lottery, depending on the time T. The abscissa axis - trivial strategy timeout, i. The ordinate axis - probability of winning with such time T. Looking at Figure 7, we determine the optimal time T. The form of the graph depends on the history period and length.

The graph always falls down to big values of time about seconds. Optimization of the Take Profit constants by the maximal balance makes no sense: big emissions happen very seldom, maybe once per all the time of EA functioning, and even more rarely. If we run optimization by the maximal balance, it will simply adjust to this given piece of history. The remaining probability of 0. With probability of 0. Figure 8. Lottery time. The abscissa axis - number of trades. The ordinate axis - probability of win the lottery for a given number of trades.

Figure 8 shows the curves that demonstrate the probability of winning and losing, depending on the number of trades. The blue curve - the number of trades in the general case, the red curve - the number of trades in case of winning. Lottery may take up to six months or more trades. Winnings are the most likely during month of lottery trades, red curve. We have created the lottery Expert Advisor optimized for specific trading conditions. EA is written in the simplest way of all the possible options.

Pros and cons of the lottery Expert Advisor are obvious.

Sharpe ratio: calculating the effectiveness of a trading strategy | Liteforex

Despite the best efforts of developers, the implementation of even a trivial algorithm requires a non-trivial ingenuity, knowledge of mathematics and MQL5 language. But, thanks to the efforts of developers, the implementation is still possible. It is actually a different approach to most seen around, where the objective is always to obtain a positive expectation.

The Risk-Reward Relationship

It would be interesting to analyze how the probability of winning in this lottery is modified as technical analysis kicks in or, in other words, how we can become an "informed" lottery player, which knows, for instance, that some balls have different weighs and so their probability is not exactly the same. When developing a trading system, there usually arises a problem of selecting the best combination of indicators and their signals.

Discriminant analysis is one of the methods to find such combinations. The article gives an example of developing an EA for market data collection and illustrates the use of the discriminant analysis for building prognostic models for the FOREX market in Statistica software. How many cores do you have on your home computer? How many computers can you use to optimize a trading strategy? We show here how to use the MQL5 Cloud Network to accelerate calculations by receiving the computing power across the globe with the click of a mouse.

The phrase "Time is money" becomes even more topical with each passing year, and we cannot afford to wait for important computations for tens of hours or even days. Most developers need to have their code secured. It covers password protection, key generators, account license, time-limit evaluation and remote protection using MQL5-RPC calls. And while the MetaQuotes team spares no effort to bring about the possibility of direct inheritance of ex5 library classes, we are going to implement it right now.

You agree to website policy and terms of use. Do you like the article? Share it with others - post a link to it! Use new possibilities of MetaTrader 5. MetaTrader 5 — Trading Systems. Algorithm Idea Proposed is the following trivial algorithm to solve the problem. Enter the market in a random direction.

Wait for a given time T. Exit the market. Check your account. If we have won the lottery or have gone bankrupt, then finish the trade, otherwise - go back to Step 1. Figure 1. And most importantly - this way is as simple as possible: If equity is greater than balance 2 or 3 times - take your profit. Time of Waiting T If we are to enter and exit the market very often for example, every minute , the rate will change little and profit we will be too little, but we still have to pay the fixed spread. Without going into mathematical explanations and surveying, I will provide the following graph: Figure 2.

The boundaries and the center of the equity probability distribution function, when trading for one day with different times of T On the graph in Figure 2 the abscissa axis shows time T - time of one trade of our trivial algorithm. Let's draw it in a bigger scale: Figure 3. Profit of trivial trading strategy with sufficiently successful guessing at different times of T Looking at Figure 3, we see that it is not profitable to trade more frequently than every 30 minutes - the spread devours all the profit. Selecting Currency Pair Since we consider rates of all the currency pairs as random walk, among all the rates we need to choose one with the largest average relative size of bar.

The indicator oscillates in the range of times After writing this article, I have accidentally discovered that the volatility indicator Kaufman Volatility from the Smarter Trading: Improving Performance in Changing Markets book by Perry Kaufman included into standard delivery of MetaTrader 5 client terminal is virtually the same as the Maximal Yield Indicator. At the same time note two interesting properties of the indicator. On the H1 timeframe indicator shows daily oscillations of trading activity volatility see Figure 5.

Export the optimization results to Excel and draw the graph: Figure 7. Conclusion We have created the lottery Expert Advisor optimized for specific trading conditions. Pros: You can play the lottery alone. No need to sell millions of tickets. The question arises: how do you develop a strategy that is optimal in terms of profit and risk? Which is better: low or high profit and risk? This is where the Sharpe ratio comes to the rescue. In the short term, cryptocurrency was in a better position, but because of the high risk, cryptocurrency investors suffered losses in a year, while the depositors got a stable income.

In , he received a Nobel prize for his Capital Asset Pricing Model CAPM , and today the coefficient he developed is used not only in investing and trading, but also in the economy of enterprises. The Sharpe ratio shows how much more income the strategy brings compared to the base interest rate, investments in which are considered completely risk-free. The ratio formula is as follows:. When comparing strategies on Forex, there is no risk-free income, as there is no benchmark with near-zero risk in the over-the-counter market. In MT4, the Sharpe Ratio for Forex Trading is the ratio of arithmetic average profit average income over a period to standard deviation.

How to Place Stop Losses and Take Profits Using a Maximal Strategy

How effective this approach is a rhetorical question. After all, the absence of risk-free income increases the coefficient, thus distorting the result. If we are talking about the comparison of investing in different currency pairs on Forex, then it should not be taken into consideration. But if we compare Forex and the stock market, it would make sense to take the same risk-free return for Forex as you did for stocks for example, the above-mentioned yield of treasury bonds. The standard deviation on Forex is asset volatility for the analyzed period.

If the numerator uses return for 6 months, then the volatility parameter is for a similar period. If two strategies have the same return but the Sharpe ratio of the second strategy is higher, it means that it is less risky.