Good afternoon! It was no accident that we decided to tell you about two products of our company that are part of the basic software from S#. Our choice was made based on the opinions of our users, who are interested in learning a little more about the purpose of programs, how they work and how they are used in trading. It should be noted that S#.Shell and S#.API is a comprehensive solution for creating trading robots in C#. However, the use of these programs is not limited to creating trading robots. So, first let\u0027s look at what S#.API. The term API, according to Wikipedia, means: The Application programming interface (API) is a description of the ways (a set of classes, procedures, functions, structures, or constants) that one computer program can interact with another program. It is usually included in the description of an Internet Protocol, software framework, or standard for calling operating system functions. It is often implemented by a separate software library or operating system service. It is used by programmers when writing various applications. S#.API is a completely free library that allows novice and experienced traders with even basic programming knowledge to use it to create their own trading systems in the field of algotrading. The library is based on the C# language, with the ability to use it in the Visual Studio programming environment. The library is designed for the user to create their own unique trading systems: from positional strategies with a long timeframe to high-frequency strategies (HFT) that use direct access (DMA) to stock trading. The uniqueness of this product is that it is based on the work of all the basic products of StockSharp, such as: S#.Designer, S#.Data, as well as the S#MatLab. trade-terminal-system.png For example, the use of library elements is widely used to create unique cubes in the Designer program. in fact, the user takes a ready-made component represented by the program code, combines it with other components, or modifies it and applies it in the designer trading robot constructor, placing it in their own cubes. source-code-designer.jpg The Mechanism Of S#.API is based on the use of messages. This mechanism consists of three elements: - message Message, - message adapter MessageAdapter - IMessageChannel transport channel. The message acts as an agent that transmits information. Messages can be outgoing and incoming. - Outgoing messages - messages that are sent to an external system. These are usually commands that the program generates, such as the ConnectMessage message, a command requesting a connection to the server. - Incoming messages - messages coming from an external system. These are messages that transmit information about market data, transactions, portfolios, connection events, and so on. Shell-Title-frimework-api.png This mechanism allows you to unify the work on developing adapters, while at the same time allowing the user to create their own connections to various trading systems. Let\u0027s look at the main advantages of using S#.API: - Independence of the trading robot created by the user from the API of the broker or exchange used. in fact, the created trading robot can work with any connection. This way the user can easily connect their trading robot to Quik, Transaq, or FOREX without changing the program code. - S # library today.The API supports more than 70 connections (Connectors (Russia), Connectors (America), Forex Connectors, and Cryptocurrency Connectors). - The library\u0027s versatility allows it to be used by private traders, small development teams, as well as large investment companies and banks. - An important indicator is high performance, which allows you to simultaneously execute hundreds of strategies for any instrument. - High speed of processing applications in S#.API allows you to reduce the processing time to a few microseconds. - The library can use direct access to trade, such as: Plaza II, Micex Bridge, and also supports the FIX Protocol, which allows you to reduce the processing time of orders. - The definition of real slippage is achieved through realistic testing, which is carried out using ticks and glasses. This allows the user to minimize the risk of possible losses and more flexibly and accurately configure their trading strategy. - The widespread use of the C# language used in creating the library and Visual Studio environment simplifies the user\u0027s work, due to excessive information about their capabilities. For the convenience of working with S#.API is divided into blocks, which allows the user to easily find the section that interests them. The ease of installation on a computer, the prevalence of the programming language and the use environment make the library S#.API is a universal way to develop trading robots. Once a user has created a trading robot, they can connect it to any chosen trading platform or broker. Also, knowledge of working with the library allows you to develop the user\u0027s programming skills. We have considered the main element-the S#.API that all the basic StockSharp software products are built on. Great, now it is clear that with the use of the S#.API users can create their own trading robots and use them in trading. However, using the Visual Studio development environment is not very convenient for working with created trading systems, let alone testing trading systems. For convenience and ease of operation, StockSharp has developed a ready-made graphical framework with the ability to quickly change to the needs of the user - trader, while open source, created in C# - S#.Shell. Let\u0027s look at the main advantages of this graphical framework: - The main advantage of the product is open source code. What does this give the user? gui-shell-source-code.jpg The open source code of the program allows the user to use all the features of the product, complementing it with their own add-ons. The user can set up their own control panels, use ready-made elements, or create their own. Easy configuration increases the speed of preparing the program for launch. Availability of S#modulations.Shell, allows you to create a user-friendly environment that is understandable to them. Shell-Title-frimework.png Thus, the use of open source code does not just allow the user to create a convenient individual interface, but it is ideal for creating custom trading robots, and this expands the scope of the user\u0027s knowledge, opening up a resource for additional earnings. - The next undisputed advantage of S#.Shell supports more than 70 different connections to global exchanges (Connectors (Russia), Connectors (America), Forex Connectors, Cryptocurrency connectors, General). gui-shell-connector-exchange.jpg - S#.Shell allows the user to fully test their trading systems before entering real trading. Convenient statistics, Equity curves, and a detailed report on the testing process allow the user to take into account possible risks at the development and testing stage and make changes to the trading robot code. gui-shell-equti-exchange.png - The user can also save backup copies of their trading robots, restore settings and compare changes with the original code of the trading robot. - A very important and convenient S#function.Shell is a simultaneous launch of strategies. What does this mean? The user is no longer limited to a single platform for work and can also apply a set of several strategies that can operate separately from each other, or can be applied as a set of strategies. Such complexes allow you to compensate or insure each other, conduct a policy of hedging and arbitration. At the same time, the user receives detailed information about the course of trading, receiving information about orders, transactions, positions, profits, logs, and other information, the output of which can be configured in the program. The user can also set up a scheduled strategy launch by setting a clear schedule for each of the launched trading strategies. S#.Shell is a convenient and multifunctional software solution that can be customized for the user. To sum up, we can say the following, that the use of the complex from the S#.API and S#.Shell, allows the user to get a fully customizable shopping complex for their needs. The user gets not just a shell for trading, but a solution for testing, trading, and complex interaction of their created strategies with different markets simultaneously or separately. Ease of use is obvious, it not only reduces the time to prepare and trade, but also allows the user to develop solutions for sale, which increases revenue. A convenient training course from StockSharp allows you to quickly master both programs, learn how to program and earn money. S# source code already included in the price S#.Shell and additional trading systems reduce the user\u0027s costs and allow you to start trading immediately.
Stop-Loss-a type of order whose task is to set limits on possible trading losses. This order is used automatically using automated trading systems, which we will discuss later. The essence is very simple: with the help of the Stop-Loss mechanism, when the set price level of the purchased asset (instrument) is reached, the position is closed. In fact, Stop-Loss insures the trader from an unplanned price drop. This restriction mechanism is widely used for traders. It is used by experienced participants in the financial market, but novice traders often neglect this mechanism, although for them Stop-loss is almost the main method of saving their funds in a positive balance. stop-loss-order-trade.jpg Stop-Loss, from a technical point of view, is a regular pending order that has an activation mechanism when the set price level of the asset is reached. The difference between the two types of pending orders is that when using a regular pending order, a new deal is opened, and when using a Stop loss, an existing one is closed. As mentioned earlier, an important advantage of Stop-Loss Is the automation of the process, which eliminates the need to track price changes and make a decision manually. Of course, this reduces trading losses and time, which is fundamental for high-frequency algorithmic trading (HFT). For example, in the program for creating trading robots Designer, it is possible to use the Stop-Loss mechanism by using the position protection cube, which can be configured and used as a reliable tool for reducing losses. stop-loss-protection-trading.png The use of the Stop-Loss pending order mechanism is widely used to reduce trading costs caused by losses. As a result, this leads to an increase in profits, not only by increasing the volume of successful operations, but also by reducing the volume of unprofitable ones. The use of this tool in trading strategies is now increasingly used, as it reduces losses, increasing the amount of profit at a constant (regulated) amount of transaction costs. Example of a trading strategy executed in the Designer program. Stop-Loss-trade-strategy-robot.png So, the main advantages that are inherent in a pending Stop-Loss order: - Using a pending Stop-Loss order in trading strategies allows you to limit losses on a single trade by setting the loss level that is set by the trader himself, which makes the trading strategy more flexible and less risky. - The use of this pending order insures the trader from an unpredictable situation in the market, in which the asset value may collapse, thereby protecting the user of the trading strategy from losing capital. - Regulation of possible losses also has a positive effect on the trader\u0027s emotional state, preserving his nerves and psychological health. There are a lot of reasons in the market that can cause a loss, and the frequency of their occurrence is unpredictable. However, the use of Stop-Loss allows you to protect yourself, make trading more convenient, limit risk, maximize profit, reduce the time to work with a trading strategy, and reduce the risk to emotional health. An important point for working with a pending Stop-Loss order is to calculate the correct order level. When placing an order, you need to know the following: - First of all, a Stop-Loss order is a conditional order that is executed when the set price level is reached. - The application consists of two parts: the application and the condition for its execution (conditions that are edited by the trader, and when a new condition is set, the old conditions are canceled). - The request is located on the broker\u0027s server, through which the trade is carried out, and is sent only when the necessary condition is reached. Let\u0027s look at the most well-known methods of working with Stop Loss: - Fixed Stop-Loss: The trader sets the value in the tool settings equal to the number of points from the initial price of the asset to open the order. - Flexible Stop-Loss: A more flexible method that takes the result of market analysis (minimum and maximum prices for an asset for a period, price change charts, and other analysis tools) as the basis for setting the opening price value. This is a more complex, but more reliable method than the previous one. - Break-even trading: A rather complex method aimed at dynamically changing the set Stop-Loss level by moving the set value from the drawdown area to the guaranteed profit area at a time when the price has already changed significantly in the set direction. - Trailing stop: A more advanced method of the previous method, which involves automatic means of transferring the Stop-Loss level. - Trend: We will devote a separate article to this method and analyze it later. Let\u0027s add a few more words and talk about Take Profit. Just like Stop-Loss, Take Profit is a pending order aimed at fixing profits. When the asset price reaches the price set by the trader, the order is executed, and the trader makes a profit by closing the position. The level of execution of Take Profit is set by the trader himself, and as in the case of Stop-Loss, it is often used with the use of automated trading systems, trading robots and trading systems. This type of order - limit, is executed only when the asset price reaches a predetermined level. There are two types of \"entry into a position\" - the beginning of trading operations: - Long position (long, long, buy) - purchase request; - Short position (short, short, sell) - request for sale. If we start trading with a purchase, we set the take Profit order execution level above the asset purchase price. If we start trading with a sale, we set the take Profit order execution level below the asset\u0027s sale price. take-profit-sell-buy-order.jpg In conclusion, it is worth mentioning the ratio of the orders considered. Using both orders reduces the risk of loss and increases profit. The use of both of these orders in each of the trading situations is purely individual, it is impossible to say unequivocally what is most applicable, what is least. The level of use of pending orders is determined by the trader, in relation to each situation and trading strategy separately. However, the combination of techniques with the use of pending orders and trading robots makes it possible to facilitate the work of the trader, makes it possible to concentrate on analysis, reducing the time to track the situation on the stock market.