Exchange trading systems on the Russian stock market. Basic stock trading strategies and their features. Futures and options market FORTS

Stock trading

Good afternoon, trading blog readers. Trading systems are a kind of business plans for trading. Working without them in the financial markets is like putting a ship into the ocean with lowered sails. You should have a diagram before your eyes that outlines all the necessary criteria for trading point by point. If you look at it, trading systems are your path to less emotional and more profitable trading.

For some reason, some novice traders believe that discretionary trading– this is trading by mood, by stars, or by something else, but not by a trading system. Yes, the final decision always remains with the individual, since he or she always has a choice: trade everything or settle only on the best options. For example, when a trading system finds 10 stocks for a discretionary trader that meet his criteria, he will not trade all 10, but will select the best few based on the presence of a trend, the strength of the price movement, and execution relative to the rest of the market. But remember, a trading system with clear rules is always present.

System traders, on the other hand, follow their trading systems with mechanical precision. Since they are based on absolute rules, this type of trading is well suited for partial or full automation. For example, a strategy can be written in the form of a script in a trading platform and after it is launched, the computer will begin trading without your participation, including identifying a deal, sending an order, managing and closing a position.

Always remember that any type of trading requires an adequate trading strategy. We will talk further about how to develop them.

Rules for creating trading strategies

Trading system is a set of rules on a piece of paper (not in your head or on the computer) that determine how and where you will trade, and includes the following components:

Market

Today, a trader is not limited solely to stocks. You have a wide range of trading instruments to choose from, including bonds, commodities, currencies, exchange-traded funds, futures, options and e-minis (mini futures contracts). However, in order for your trading to have a chance of success, you need to focus on instruments that have good liquidity and volatility. Themes trading instruments, liquidity and volatility we discussed in the relevant articles.

It's important to note that a strategy that works well for stocks may not necessarily work for, say, futures. You should have different trading systems developed for different markets. Many successful traders work in the following way: first they focus on trading one instrument, and then, as the necessary skills gradually increase, they add others.

Timeframe

Timeframe– this is the chart interval on which your trading decision is made. In many ways, it is associated with a trading style. In other words, the longer you plan to hold a position, the larger the interval of your charts should be. For example, a swing trader spends most of his time analyzing the day, while a scalper bases his trading decisions on analyzing the minute.

Remember the following: price activity (liquidity and volatility) remains the same on different timeframes for the same trading instrument; but the same trading instrument can look different on different timeframes, for example, wonderful on the daily, but terrible on the 5-minute. Therefore, indicate in your strategy which chart interval you analyze most often and on which you base your trading decisions.

Indicators

Trading systems must include any indicator that is used on your chart. Technical indicators are mathematical formulas based on the past or current price of a security, as well as its trading volume. Various types are used, for example, to determine trend, momentum, volatility or volume, but none should be used by you as a buy or sell signal generator. The purpose of the indicator is to indicate securities that meet trading criteria and are approaching your entry point into the market.

Additionally, each indicator has its own settings, which you must also add to the strategy. For example, if you use a moving average, then you need to specify its period: 10, 50, 200, etc.

Position size

Trading systems that do not take this criterion into account are doomed to failure. This is one of the most important points because it determines the amount of your risk.

Position size- This is the dollar value of your trade, or the number of securities that you allow yourself to trade in one trade. It is determined as a percentage of the trading capital, for example, 0.5%, 1%, 2%, 5%, etc., and is never violated or changed arbitrarily.

In general, it is normal for a novice trader to start his trading with a minimum position size, say: 1 lot for stocks or 1 contract for futures. With time and experience, the bar can be raised, taking on greater risks each time.

Entering the market

Traders are either conservative or aggressive by nature, and this is reflected in their rules for entering the market. Conservative traders may wait for a lot of confirmation that they are right before opening a position, while aggressive traders sometimes rely on minimal market signals. Regardless of what type you are, the rules for entering the market should match your perception of risk, since this is precisely the moment when you are risking part of your trading capital.

Always keep this in mind: the more confirmations you need, the less trading activity you will have, and the more trading opportunities you will miss; the opposite applies to aggressive entries.

Trading systems describe the rules for entering the market with two components: trading filters and entry points. Trade filters is a set of conditions that must be created by the market for the transaction to be executed. Think of them as a safety net for your entry point. In the form of trading filters, we use different price movements or indicators that create conditions for us to safely open a position.

Point of entry- this is the only criterion on which we base our decision to issue an enforcement order. Let me show you an example based on a swing trading strategy:

  1. Trading filters for a long position (creating a bottom):
  • Daily timeframe
  • The 10- and 30-period moving averages indicate an uptrend, with price falling between them
  • The presence of at least 2 downward days in a row
  • Trading is carried out near the support level
  • The S&P 500 market indicates a buy
  1. Entry point (at the base):
  • Entering the market with a market order at the end of a trading session that closes above the previous day's high
  • If an important candlestick pattern is formed, then enter the market at the end of the trading session, when there is confidence in its final formation.

Please note that when creating an entry point, it is important to indicate the types of orders with which you are going to open positions. Therefore, follow the highlighted link and read about it in more detail.

Exit from the market

In my opinion, this is the second most important item after position size that trading systems should describe. For example, when trading stocks, you will not experience a loss until you close your position. How and at what level you will do this needs to be decided.

When creating rules for exiting the market, remember that each transaction has two paths of development: profitable and unprofitable. In other words, you need to take into account both the option of a possible loss and its limitation, and the option of a possible profit and the level of its fixation. Here are the criteria you will need:

  1. Position management strategy in case of its profitability
  2. Stop loss level
  3. Trailing stop level
  4. Time. For example, closing a position at the end of a trading session or something similar.

Let's look at my proposed rules for exiting the market:

  1. Initial stop loss level
  • 1-2 cents below the low of the reversal pattern
  • Per level of support
  • At least 1 ATR
  1. Managing a Profitable Position
  • The stop loss is moved after the end of the trading session to the low of the previous day. The position is closed by the market.

Trading systems are absolute conditions for successful trading in financial markets, like business plans for enterprises. We looked at the basic rules and criteria by which strategies are created. But it’s also important to learn test trading systems to determine their effectiveness, which we will talk about in the next post. Trading Blog thanks for your attention. Be successful!

The Russian Trading System (RTS) is a large exchange structure on which securities are traded, accessible to both private investors and large companies and investment funds.

RTS was created in 1995 after the merger of several regional trading platforms into an organized securities market. Initially, RTS was created as an over-the-counter alternative. Bidders agreed on the deal over the phone, after which they submitted their bids in the electronic system.

Now the RTS is a full-fledged stock exchange where hundreds of different securities are traded. From the trading system, RTS has grown into a group that not only organizes trading, but also provides a wide range of additional services (clearing, depository, settlement).

RTS Group structure

  • OJSC Stock Exchange "Russian Trading System" (controls the activities of all other structures);
  • NPO CJSC "RTS Clearing House";
  • CJSC RTS Clearing Center;
  • CJSC Depository Clearing Company;
  • OJSC "St. Petersburg Exchange";
  • LLC "Technical Center RTS".

In addition, the RTS group includes a number of foreign exchange organizations located in Kazakhstan, Ukraine and England.

Activities of RTS

The RTS currently operates several trading platforms, both exchange-traded and over-the-counter, as well as a derivatives market. Let's look at each of them in detail.

Stock market

There are 4 platforms within the RTS stock market: RTS Classic, RTS Standard, RTS Start and the T+0 market.

Classic securities market

The RTS Classic market is the oldest organized platform for trading securities in Russia (it has been operating since the foundation of the exchange in 1995).

Features of the FORTS market

  • relatively low costs for transactions for the purchase/sale of assets;
  • no additional indirect costs (payment service fees and depository fees);
  • great opportunities to use various trading strategies;
  • the possibility of insurance against price fluctuations for certain assets (, dollar exchange rate);
  • partial deposit of funds (initial margin);
  • carrying out transactions with guaranteed income (for example, we sell futures and buy shares).

Among the main market opportunities that are available to everyone, it should be noted that speculative transactions with futures securities, as well as hedging (insurance) of existing risks.

Let's take a closer look at how these strategies are implemented for stock futures.

Speculation

Stock futures are an excellent tool for making profits: you can play on the rise or fall in stock prices in order to make a profit.

For example, you expect that in the future the shares of a certain company will increase in price - then you need to buy futures on shares of this company. If, on the contrary, you expect that the shares will fall in price, then you enter into a contract to sell futures.

The advantage of performing transactions on the futures market is also that when concluding a transaction on a futures contract, the investor contributes only a small fraction of the value of the asset (guarantee collateral of about 10-20%).

Consequently, the investor saves on transaction costs.

For example, you want to buy futures on shares of the Alpha company, the total cost of the contract is 100,000 rubles.

However, you will not have to pay the entire amount of the transaction, but only the amount of the guarantee, which is 15,000 rubles (this is what the broker will write off from your account). That is, having spent only 15,000 rubles, you actually bought a contract for 100,000 rubles.

Hedging

In this case, the investor’s actions are aimed at reducing possible risks associated with a fall in the price of his shares. To minimize possible losses in the stock market, the investor enters into a futures contract to sell.

As a result, possible losses on the stock market are compensated by profits received on the FORTS market.

For example, you have shares of the same company “Alpha”, which now cost 100 rubles per share. You are afraid that in a month these shares will fall in price, in order to insure against possible losses, you enter into a futures contract to sell securities at the current price.

Then, if in a month the price of the shares really falls, you will compensate for the losses by selling the shares at the price of 100 rubles, which was indicated when concluding the futures contract.

However, there is one thing: if the price rises, then on the contrary you will lose the opportunity to make a profit. That is, hedging is a kind of insurance, a tool that is aimed only at preventing possible losses, but not at making a profit.

Over-the-counter activities of RTS

RTS's over-the-counter activities include organizing the work of two indicative securities quotation systems: RTS-Board and RTS Global.

RTS Board

RTS Board is a special information system that began operating in 2001 and is designed to carry out indicative quoting of securities that were not admitted to trading on the RTS Stock Exchange.

Unlike the stock market, here we are dealing with quotes that are not based on actually completed transactions. Indicative quotes show that a given security could be sold at a certain price stated by the issuer.

The actual price of the security at the time of the transaction, if one takes place, will depend on a number of additional factors (the volume of the transaction, the day of settlement, the status of the buyer, etc.).

That is, the RTS Board is not a trading system, but an information system that allows potential investors to get acquainted with information about securities that are not admitted to public trading on the stock exchange.

For small domestic issuing companies, the RTS Board is a tool for initially increasing (the speed of sale) the securities they issue, as well as an opportunity to draw the attention of potential investors to new and promising securities.

RTS Global

RTS Global is an RTS project that began its work in 2008. The system allows investors from Russia to gain access to securities of foreign companies.

RTS Global is based on the technologies and operating principles of the RTS Board system, only here investors have access to information about indicative quotes of not domestic, but foreign securities.

In addition, with the help of the RTS Electronic Agreement Center (ECC) and CJSC Depository Clearing Company, Russian investors can, through the RTS Global system, enter into over-the-counter transactions with shares of a number of foreign companies, mainly companies from the CIS countries and Europe.

Thus, CJSC DCC has access to a number of foreign depositories, including:

  • Clearstream Banking S.A. Luxembourg;
  • Euroclear Bank S.A./N.V;
  • National Depository of Ukraine;
  • "Republican Central Securities Depository" of Belarus;
  • Central Depository of Kazakhstan.

The emergence of an over-the-counter market for foreign securities in Russia has significantly expanded the boundaries and capabilities of the domestic stock market.

RTS Index

Since the RTS is a stock exchange, it is imperative to talk about the RTS stock index, which has been calculated on the exchange since the beginning of the first trading in September 1995.

The RTS Index is the main indicator of the general condition of the Russian stock market, reflecting its growth or decline.

The principle of operation of the index is the same as that of the index - it reflects the total change in the value of a certain set of securities based on the results of trading.

Only unlike, which takes into account changes in the price of shares of 30 companies, the RTS Index is calculated based on indicators of the dynamics of securities of the 50 largest enterprises in Russia, including:

  • Aeroflot;
  • Bashneft;
  • Severstal;
  • Gazprom;
  • MMC Norilsk Nickel;
  • INTER RAO UES;
  • LUKOIL;
  • Sberbank of Russia;
  • Surgutneftegaz;
  • and others.

It should also be noted that the RTS Index shows the total market capitalization (value) of shares of companies included in the list, expressed in relative units (points). In this case, unlike the MICEX Index, the value of shares in US dollars is taken for calculation.
Capitalization in this case is defined as the number of outstanding shares multiplied by their actual market value. It reflects the total value of an enterprise at a certain point in time.

Accordingly, if the value of shares of enterprises included in the list for calculation increases, the value of the RTS index also increases, if the value falls, the index falls. The index itself is calculated simply.

Let's say the initial capitalization of the companies was $100,000, the initial index value was 100 points. The companies' capitalization currently amounts to $500,000. Therefore, the index will be equal to 500,000/100,000 * 100 points * 1.0752559 = 537 points (1.0752559 is the established adjustment factor).

It is according to this scheme that the value of the RTS index is determined, the dynamics of which reflect the state of the domestic stock market.

What do you need to become a trading participant on the RTS?

Only legal entities that have licenses to carry out transactions with securities can take part in trading on the RTS markets.

If you want to participate in trading on the exchange as a private investor, then to carry out transactions on the RTS exchange, contact accredited professional intermediaries (brokers, dealers, management companies) who have the appropriate licenses and experience in performing such transactions.

An accessible way to make money for many is trading on the stock exchange. Where to start and how to increase capital? Take trading training to gain basic knowledge and take your first practical steps. As part of the course, a novice trader will learn the basic strategies for trading on the stock exchange: how they are useful and what features are typical for each of them.

Stock trading strategies: what they are and how they work

The right choice of trading strategy for a novice trader is the key to success. A direct road to disappointment for a beginner will be the idea that it is enough to take a ready-made trading strategy, apply it and get a huge profit in your pocket. Following illusions leads away from reality and as a natural result: denial of one of the most accessible ways of earning money.

Trading gives a chance to increase income to a wide range of people, because when trading on the stock exchange, neither gender, nor education, nor age is important. The main thing is to have personal qualities and a good knowledge base, which necessarily includes familiarity with trading strategies.

What are stock trading strategies? This is a system or a clear algorithm of actions with the help of which a trader manages his trading on the stock exchange, makes decisions in order to make a profit during a certain market situation. Trading strategies help to understand the structure of the market, its mechanisms, but, alas, there are no universal strategies for trading on the stock exchange.

If we take complexity as the main criterion, then trading strategies are as follows:

  • simple (effectiveness and ease of understanding make them suitable for novice traders);
  • basic (basic trading systems that should be taken into account when creating your own strategy);
  • advanced (used by experienced traders, but do not operate with a large number of different indicators);
  • complex (complex methods taking into account many factors that can only be used by traders with extensive practical experience in trading on the stock exchange).

When the time factor is taken as a basis, trading strategies on the stock exchange are usually divided into:

  • scalping (a large number of transactions in one day with a minimum profit);
  • intraday trading (during the day, a trader can make a profit due to a slight fluctuation in the price of an asset or on a large intraday trend, while the transactions themselves are opened and closed on the same day);
  • medium-term (the transaction goes beyond one day, which carries the potential for big profits for the trader);
  • long-term (used by large players to maximize profits).

Basic stock trading strategies

Clear, simple, effective and also profitable (if used skillfully, taking into account the circumstances) - these are the general criteria that characterize basic trading strategies. Trading training provides a detailed introduction to the basic strategies, but in the future the trader will have to develop his own trading strategy on the stock exchange in order to earn income.

What trading strategies are classified as basic? The list is quite arbitrary and includes strategies that are known, tested and often used by experienced traders, and are also relatively easy to understand for beginners. Taking these factors into account, the main strategies for trading on the stock exchange include the following:

  1. Trading on pullbacks or counter-trend trading (the movement of a price or trend in the stock market is accompanied by a rollback or a period of correction. On the chart this is displayed in the form of a complex broken line, where the trader must be able to find a short period when the price moves against the trend. The market's respite time before the next breakthrough gives the trader the opportunity take the profit).
  2. Trading without stops (the strategy itself is called conditionally; rather, it is an option to exit a position, since the stop loss is a pending order. Choosing this trading strategy requires serious risk control and experience in money management; trading psychology plays a huge role, therefore this trading strategy The exchange is suitable either for professionals or experienced traders, but not for beginners).
  3. Price Action or price movement (it is based on price patterns, trend lines, candlestick patterns and no indicators, i.e. this effective trading strategy helps predict the direction of price movement and when is the best time to open a position).


Other common and used trading strategies in trading include the following:

    • Based on a combination of indicators;
    • Moving averages;
    • Fibonacci levels;
    • Ichimoku indicator;
    • Japanese candles;
    • Fundamental.

Do you want to get training in trading and practice trading on the stock exchange? Come to the courses at the Alexander Purnov School of Trading, where there is a step-by-step program - for beginners from complete scratch to professional. Not sure you want or are ready to do it now? Then subscribe to the blog of the Alexander Purnov School and read useful materials on

Regular readers of this blog know that I enjoy creating trading systems using Amibroker; which allows me to test different investment strategies against historical stock data.

In my opinion, trading systems are extremely valuable because they allow you to trade without emotion. Today I came across a strategy that is simple but incredibly powerful and if you continue reading you will see the rules of this amazing trading system.

Putting Warren Buffett down :)

Between 2000 and 2012, the trading system produced an average annual return of 172.45% with a drawdown of 14%. Which gives her CAR/MDD ratio of 12.34.

The Sharpe ratio is 3.91 and the earnings ratio is 9.29. This is a truly remarkable result that can make you the richest person in the world in just a few years!

As you can see from the stock chart and monthly results table, this trading system produces amazing results in the US stock market.

Starting with $10,000 in capital, the system produced more than $1.6 billion in just 12 years. In this case. you'll be richer than Buffett in no time. You can even become the very first trillionaire!!!

So what exactly are the rules for this system?

//Start System Code
SetFormulaName("APRIL FOOLS");
SetOption("InitialEquity", 10000);
PositionSize = -100;
Buy = Cross(EMA(C,2),EMA(C,5));
Sell ​​= Cross(EMA(C,5),EMA(C,2));
BuyPrice = O;
ClosePrice = O;
//End

[collapse]

Unfortunately, the trading system is a “joke”, that is, it is an unrealistic trading strategy (alas, today is not April 1st, but I think I amused you).

The trading results and equity curves are real and were produced at Amibroker. However, the system code was designed in such a way that the results cannot be relied upon, but it does an excellent job of showing that you cannot rely on tests alone and re-optimizing the strategy is also important.

There are at least five major flaws in this system.

1. Curve fitting

First of all, the trading system was tied to existing data. The parameters for the moving average crossover were optimized to find the values ​​that would result in the strongest performance in the test period. If we use these options in the future, there's a good chance they won't work as well.

2. Future leak

Secondly, this system truly looks to the future. On the fifth line (above), we instructed Amibroker to buy the stock when the 2-day EMA crosses the 5-day EMA. However, this EMA (exponential moving average) is calculated using the closing price, and Amibroker is actually buying the stock at the open price (line 7). In other words, we buy stocks ahead of the EMA crossover, knowing it will happen later. And this is definitely impossible.

3. Zero commissions

Thirdly, this system does not use any commissions or slippage. In real life, it costs money every time you make a trade. You are also not guaranteed execution at your desired price, especially for large orders. No commission or slippage is unrealistic and can have a big impact on the simulation results, especially when trading on short-term timeframes.

4. Evasion of inheritance rights

Fourth, this system suffers from aggravation. The system buys stocks from the S&P 500 universe, but in this case we did not include historical components or delisted stocks. This means that our results fell victim to successor rights bias.

In real life, enterprises go bankrupt, are taken off the stock exchange, and some merge with other companies. These changes are not always reflected correctly in historical databases. Thus, it is always important to use data that is free from inheritance bias. Such data can be obtained, for example, from Norgate Premium Data.

5. Liquidity

Finally, the system relies on unrealistic liquidity. When you buy a stock in real life, your position size and entry price will be determined by how many shares are available to buy at that time, also called volume. Typically, you wouldn't want to buy more than five or ten percent of the total, otherwise it would understandably move the share price against you. This system has a limit of 50%, meaning it is able to buy half of the daily volume without any movement towards the purchase price. This is unrealistic.

Starting the system again

Now we know what the main flaws of this trading system are, we can fix them, move the dates forward and run the system again using objective out-of-sample data from 2012 to 2016.

Incredibly, the trading system actually made money in out-of-sample testing even though the rules were closed. However, as expected, it did not achieve the same level of performance.

The truth is, you will never find a trading system that makes 170% per year. Despite the fact that thousands of traders are deceived every year, I buy such systems from scammers.

So, sorry for getting your hopes up on the dream of a 170% APR trading system. But I hope that you have at least learned to look for something when you are building or analyzing a trading system.

Thanks for reading. And have a fun day 😉

  • Translation

Note:This post was written by British developer and financial analyst Michael Hulls-Moore, who is a professional in the so-called Quantitative trading. From our point of view, the information contained in this topic may be of interest to technical specialists and developers who are interested in the stock market and have the skills to create, for example, successful trading robots, but do not know where to start. Therefore, the topic will be considered in this context; in addition, the text is adapted to Russian realities, and some terms are translated accordingly. We welcome your comments! (It is better to send translation corrections in private messages).

Algorithmic trading is an extremely complex area of ​​finance, and it will take quite a lot of time to master the amount of information that will allow you to create your own trading system or get a job as a developer in a financial company or fund. Extensive experience in programming is simply necessary for successful work in this market; at a minimum, an algorithmic trader must be well versed in languages ​​such as C/C++ (Java is also promising in the field of finance) and Python, Matlab and R ( TradeScript, developed in the USA, is gaining popularity in the Russian market - approx. translation).

Any high frequency trading system consists of four main components:

  • Strategy identification - that is, determining the trading strategy, exploiting the advantages contained in it and choosing the frequency of trading.
  • Backtesting of a strategy - obtaining historical data on trading and “running” the strategy on them, analyzing the results and optimizing weak points.
  • The engine is the part that connects to the brokerage trading system ( ITinvest recently launched a new Matrix system - approx. translation), automatically trades and adapts to changes in the market to reduce costs.
  • Risk management is the distribution of capital to carry out trading operations in the optimal way, determining the sequence of actions in the event of an unsuccessful set of circumstances on the market.
Let's start from the first point and talk about how to choose a trading strategy.

Trading strategy

In trading, any action is always preceded by the stage of collecting and studying information. Before choosing a strategy for trading, it is necessary to analyze initial data such as the amount of available funds, and also take into account how the new strategy is combined with those already in use. Individual traders are simply obliged to pay great attention to transaction costs and do their best to reduce them; the optimal trading strategy is selected accordingly.

Contrary to the popular belief that “no fool would share a strategy that makes money,” in fact, in public sources you can find information about strategies that actually work. In addition, analysts and scientists sometimes publish the results of their research and financial experiments. There are quite a few blogs on the topic of algorithmic trading in English (in Russia, sometimes interesting topics pop up on the Smart-lab.ru resource), and data on trading strategies of funds sometimes gets into the press.

Of course, no one will discuss in public all the aspects and details of setting up a profitable strategy. The key to profitability lies precisely in understanding what parameters the strategy should have, as well as its “fine tuning”. However, the almost 100% way to create your own strategy is to “steal” other people’s ideas and then refine them.

Most strategies can be divided into two large groups - “playing on inefficiencies” and “following the trend”. The first type of strategy exploits market inefficiencies (for example, spreads in the prices of related financial instruments) and the fact that in the short term the price of assets often returns to their original level. Trend strategies play on the psychology of investors and the actions of funds, trying to “jump” on the train of a new trend and manage to collect profit on this before the movement reverses.

Another important aspect of algorithmic trading is its frequency. Low frequency trading (LFT) involves holding a financial instrument for more than one trading day. Accordingly, with high-frequency trading (HFT), all transactions occur “intraday,” that is, within one trading day. There are also so-called ultra-high frequency strategies (UHFT), which involve holding an asset for seconds or even milliseconds. High-frequency trading has now gained great development in global and Russian markets.

Once a strategy is selected, it is necessary to test its effectiveness on historical data. This process is called backtesting.

Backtesting

The essence of backtesting is to confirm or refute the profitability of a chosen strategy launched on historical data. Knowing the results that a strategy would have shown in the past allows us to assume its effectiveness in the current market situation. Of course, the fact that a strategy brought in a virtual million based on historical data does not guarantee success in the real world.

When backtesting, the most important point is the availability of data on past trading sessions to launch the strategy. There are several ways to obtain this data - brokers and exchanges often provide it, but there are also third-party data providers.

It is also important to determine the metrics that will determine how successfully or unsuccessfully the strategy worked “on history.” The industry standard is the concept of "maximum drawdown" and Sharpe ratio. The maximum drawdown is the maximum loss on a portfolio over a certain period (usually a year). Low-frequency strategies may have greater drawdowns than high-frequency strategies due to certain statistical factors. A backtest will show the maximum portfolio drawdown that could have occurred in the past, which will give a rough idea of ​​what to expect in this regard when working in the real current market. The Sharpe ratio is an indicator of the efficiency of an investment portfolio (asset), which is calculated as the ratio of the average risk premium to the average deviation of the portfolio.

Once the strategy has been tested and all identified bottlenecks have been eliminated, possible drawdowns have been minimized and the Sharpe ratio has been maximized, it’s time to move on to the actual development of the trading engine.

Trade module

The trading engine is the means through which the list of trades to be executed in accordance with the trading strategy is transmitted to the broker's trading system. The process of generating orders can be half or fully automated, and the mechanism for executing them can be manual, half manual (“one click”) or fully automated. For low-frequency strategies, manual or semi-manual order entry is most often used. For HFT strategies where every millisecond matters, a fully automatic method is generally used.

The main points that should be taken into account when developing a trading system are ensuring a reliable and fast connection to the brokerage trading system (usually via an API) or providing direct access to the exchange, minimizing costs (including broker and exchange commissions, as well as possible slippage).

Transaction costs are one of the main things that an HFT trader needs to think about. They usually consist of three components: broker and exchange commissions (and taxes), slippage (the difference between the price at which a trade was planned to be executed and the price at which it actually took place), and the spread of a particular financial instrument (the difference between the price purchases and sales - bid/ask). The spread is not a permanently fixed value and depends on the current liquidity of the market.

High transaction costs can turn a potentially very profitable strategy with a good Sharpe ratio into a completely unprofitable one and vice versa. It can be quite difficult to correctly predict transaction costs using a backtest; this usually requires obtaining historical tick data from the exchange, including information on bid/ask prices.

It is also necessary to remember the difference between the system's performance in the real world and what it showed in historical data. The difference can be quite significant, and there are many reasons for this. Software bugs and errors in the trading strategy itself may not appear during backtesting, but play an important role in real work on the market.

Examples of creating trading robots using TradeScript.

Risk management

The concept of “risk” includes all of the above-mentioned dangers. The risk consists of technological dangers (for example, a sudden failure of servers), broker risk (company bankruptcy), and in general anything that could potentially interfere with the intended functioning of the trading system.

Part of risk management is the process of optimizing capital (its distribution between various strategies). This is a fairly complex process that involves a lot of "math". The industry standard that describes the relationship between the optimal allocation of capital and obtaining the maximum effect from the work of trading strategies is the Kelly criterion.

Another important component of risk management is determining a trader’s own psychological portrait. Every person has some traits that can hinder successful trading in the market. In the case of algorithmic trading, the psychological effect plays a lesser role than in “manual” trading in the market, but is still present - after all, the trading robot is monitored by a person who may want to record a loss too early or rush to close a position for fear of increasing losses.

conclusions

Algorithmic trading is a very complex area of ​​human endeavor, but it is also a very interesting area of ​​finance. In order to have a chance of achieving success in this matter, you simply need to master programming at a good level. You need to train yourself by creating trading modules yourself (trading engines, data analyzers, tools for backtesting strategies), using available resources - after all, we are talking about your own money, which no one wants to lose.
Articles on the topic