text:
Articles. StockSharp https://stocksharp.com/posts/atom.ashx?category=articles&id=tags © 2020 StockSharp LP 2020-10-28T02:12:41Z https://stocksharp.com/images/logo.png https://stocksharp.com/articles/12374/Assign-install-and-work-with-SInstaller/ Assign, install and work with S#.Installer. 2020-09-01T08:41:16+03:00 2020-10-27T04:24:39+03:00 Marat https://stocksharp.com/users/101940/ email@example.com The S#.Installer allows you to:
- download and install S#.Designer, S#.Terminal, S#.Data
- install the QUIK connector,
- buy and install connectors S#.MT4, S#.MT5, S#.MatLab
- buy and install additional software
- install the program together with bought connectors
- track the process of purchasing new programs
- download the S#.API library and automatically tracks its updates.
- download the purchased training lessons, the S#.Shell.

How to install the program:

1. Download the archive Installer.zip.

2. In the archive settings to choose Unlock.

3. Unpack the archive and find the file StockSharp.Installer.Console.bat.

4. Will start the setup mode. You must wait for the full installation.
During the first installation, you must enter your StockSharp username and password.

5. After installation, open the program window.

How to work with S#.Installer:

S#.Installer allows you to:
- select programs available for download
- manage updates of downloaded programs
- purchase available paid programs

For the convenience of finding the necessary product in the program, you can choose the type of application.

To install the desired application, you need to:

1. Select the app, click install, agree to the license agreement, and click Continue.

2. After this you need to choose the installation path.
IMPORTANT! It is necessary that the folder where the program will be installed is empty.

3. After selecting the directory, click Continue.

4. Select Execute and the installation process begins.

5. After installation, you can use the program.

To delete the program, select delete and click Continue.

To repair, select repair and click Continue.

S#.Installer independently tracks all software updates and updates itself automatically. Therefore, there is no need to delete it after installation.
S#.Installer is not closed by clicking on the "X" in the program window, but is closed via the toolbar, select the menu (using the right mouse button) Close.

You can also check for updates by clicking the check for updates button in the right corner of the program window.

If updates are available, a notification will appear.

To purchase paid apps, select the software you need and click the Buy button.

 https://stocksharp.com/articles/14523/Crypto-index-in-crypto-trading!/ Crypto index in crypto trading! 2020-09-29T13:33:22+03:00 2020-10-16T21:45:04+03:00 ILYA https://stocksharp.com/users/127794/ firstname.lastname@example.com Crypto trading is a type of trading and therefore we should admit that as well as in classic trading, crypto trading has its own index.

The index reflects the condition of market of crypto currencies, based on average market indicators. As in classic trading, the index in crypto trading formed on data from the most liquid tokens. The amount of taken tokens displayed in the title. If there's a number 10, then it includes 10 different crypto currencies. The change of every of these tokens has a high effect on the index.

The growth of the components of the index therefore the index will be rising. If the rate of crypto currencies is decreasing, then the index will be cheaper.
Index is kind of basket of several components. Crypto trader can choose which components he wants and monitor all of them.
You might need an index chart to analyse the market. If the index is most common, then the chart will be shown in the appropriate resource.
But what if the index of trader portfolio investment is individual? For creating such index, the Hydra program will be indispensable. Hydra can collect the volume of each assets, calculate, and build the necessary index, moreover you can use this index in other programs just by saving it in your desirable format.
The gotten index can give you detailed and comprehensive data of the market condition. Furthermore, to work with index will give traders the opportunity to analyse the market perspective and any assets. The trader gets more effective system of crypto trading and therefore to get more benefits and reduce risk.

 https://stocksharp.com/articles/11146/Interactive-Brokers-API-what-you-need-to-know/ Interactive Brokers API-what you need to know. 2019-11-07T12:22:52+03:00 2020-05-01T16:55:25+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com For any trader who wants to play big, there comes a time when he needs to enter the international trading markets and, in particular, one of the largest markets – the US market. The abundance of brokers providing their services to the trader is not always beneficial, as various offers and conditions often put the trader at a standstill.
Let's look at the largest by the number of transactions per trading day company Interactive Brokers. Today, we can safely say that this company is the most technologically advanced company in the States in its field providing users with various types of connection to work through Interactive Brokers API.
It is very important that the broker works not only with US citizens, but also foreigners and tries to fully provide all technical support to foreign users.
A little history about Interactive Brokers. This broker has been working in the US market since the late 70s. For all the time of its work, the broker has established itself as a reliable, advanced in information technology partner. An important fact is that the broker is the only one in its field in the US market has its own clearing company. From 2010 to 2017, according to experts, Barron's Interactive Brokers was awarded the title of leader among online brokers. The broker is among the top ten, according to the resource www.stockbrokers.com, among online brokers. To date, the equity of the broker amounted to more than $6 billion, the market value ranges from $16 billion.

One of the important aspects to get started is opening an account with a broker. What are the positive aspects of broker account registration at Interactive Brokers:
- Registration takes place online, in which you fill out the necessary forms to open;
- Copies of documents for opening a brokerage account must be provided in electronic form.
After a few days, after the verification your account will be activated. Do not rush to transfer money before the end of the test, as you will not be able to use them until the documents are checked.

After it became available for the management of a brokerage account in the personal Cabinet you need to create a request for replenishment of funds.
Different currencies can be used to replenish the account, which simplifies the task for users.
Let's look at what types of platforms Interactive Brokers offers for trading:
- Mobile version of the platform, which enables online trading through mobile gadgets with iOS and Android operating systems;
- Desktop version of the platform Trader Workstation (TWS), which is a full-fledged terminal for work

- WEB application - WebTrader, built on HTML, allowing online use of trading functions and tools.
The Interactive Brokers API requires special attention. With all the positive reviews about Interactive Brokers, there is a very important point. The broker provides open source code to create its own application based on its API.
Many users who first open Trader Workstation, the desktop version of the terminal, are confused. The abundance of seemingly different related information on the screen leads to confusion. Quite a long time design, makes use of the terminal is very inconvenient and causing a large number of questions.
In order to correct the situation, the broker provided access to the Interactive Brokers API libraries, so that each user would have the opportunity to create their own terminal.

Applications that are created using Interactive Brokers API have full functionality, have access to the user's open accounts, access to market data and trading charts.
A wide range of programming languages is limited only by the choice of operating system for some of them:

Having the ability to create their own application, the user creates a convenient environment for work. For the convenience of creating your application, we recommend using our S#.API.
This program allows you to use libraries to create the necessary software product for the trader – terminal, using the C#. The library's own API, allows you to expand the capabilities of the created terminal. The integrated ability to connect through the necessary Protocol, such as FIX Protocol, through our connectors, allows you to simplify the user's work, thereby reducing the time for the development and adaptation of the application to work on the trading floor. https://stocksharp.com/articles/11748/Trading-for-beginners-Where-to-start/ Trading for beginners. Where to start? 2020-04-29T00:32:51+03:00 2020-04-29T00:32:51+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com We continue the series of articles dedicated to trading for beginners.
In most cases, young traders come to trade against the background of beautifully told stories about how easy it is to start earning money in the market.
We hasten to disappoint, trading is a difficult and painstaking process.
Most of those who flout this rule face disappointment while trading.
Trading is not a momentary success, it is a strictly developed, developed, conscious system, following which you can start earning and multiply your capital.

How do I get started?
Of course, you need to start your trading career with training.
Today, a huge number of companies offer to train you for ridiculous money, promising a fast and" win-win " trading system.
Whether to believe or not is up to you, but you need to remember that most of these "coaches" do not have the necessary competence or their system is based on the principle: bought cheaper, sold more expensive.
Many companies offering training do not have their own systems and software, but use third-party software, offering you to build your trading system on someone else's software.
In fact, they will never be able to give a proper explanation of the behavior of a particular program, and accordingly all learning will consist in pressing the buttons shown in the training. Will such training be effective? We don't know, everyone decides for themselves.
Along with such teachers, there are courses that teach not just trading on the market, but also learning how to create your own trading systems. The trader gets the opportunity to learn not just how to manage the program and trade in it, but also learn the basics and concepts of trading, with the ability to create their own trading systems and as a result, a more in-depth knowledge of the market.

For example, our training course is designed, among other things, for a novice trader who is just learning the basics of trading. It is not just about creating trading systems. But also the concepts of trade, with explanations of why you need it this way. The advantage is that you do not learn on third-party software, but use our own, so you always have the opportunity to teach updates and tips in difficult situations.

What does a trader learn during his studies?
The trader studies the market, features and nuances of trading. An important aspect is the understanding and ability to apply knowledge of technical and fundamental analysis.
Knowledge of analysis allows you, in combination with knowledge of methods of building trading systems, to build trading strategies that will allow the trader to earn.
An extensive set of programs for analysis allow the raider to learn how to use a large number of important and convenient tools. For example, Hydra not only helps you download stock quotes for analysis, but also allows you to perform a large number of operations for analysis.

trading-marketing-trade.jpg

In General, the ability to choose the right trading program for work, whether it is the TWS terminal from IB or the S#.Designer trading robot designer from S#, allows the trader to reduce the time for training.
It is important to determine which program you need.
For manual trading, you need to choose the most reliable, informative and fast terminal. It will allow you to quickly respond to changing market conditions on the stock exchange. It will provide a more detailed vision for operational analysis.
In General, not many terminals allow you to connect to several trading sources at once, but this makes trading more flexible and secure. For example, the Terminal program implements the selection of a dozen exchanges.
What does it give:
- Great opportunity,
- Ease of trading,
- Flexibility of trading strategies
- "It's free.

Many people will find manual trading uninteresting and difficult, plus time-consuming. For such traders, the choice may fall on automated trading platforms.
Here you need to understand that among them there are those on which various scenarios are pre-installed, and those on which you create these scenarios yourself (Tslab or Designer). Creating trading strategies using dice generally makes it easier for the trader to work. Now you can use the appropriate block to select the necessary operation or condition for trading your strategy.

So where do I get started? First of all, to get the necessary knowledge. Successful trading is impossible without understanding the market, without the ability to conduct technical and fundamental analysis, because it is on such knowledge that the trader's ability to build a profitable strategy depends. You need to be able to manage your capital and create your own trading system, as well as optimize it as necessary. In addition, it is important to choose the right stock broker and learn how to use the trading terminal SOFTWARE.

You can not ignore the issue of constant training, understanding the basics of trading. A trader should be able to study tirelessly. In General, the desire to learn is the key to success. New knowledge allows you to expand your trading opportunities.
An important factor of successful trading is the emotional readiness of the trader. Stress is an unavoidable companion of trading. A trader must have a cool head and a reasonable mind.
The trader must be able to clearly analyze the situation, have a sense of self-control and will, including when it is necessary to take risks.

So, successful trading is a combination of many factors that affect the choice of a bidder.
Balanced decisions are the first step to a guaranteed profit. A trader must constantly learn and improve their knowledge, must be able to make decisions soberly and make sometimes inconvenient steps.
In the following articles, we will look at what else can affect the quality at the very beginning of trading.
We are waiting for your comments and questions. Thanks. https://stocksharp.com/articles/10404/Something-about-StockSharps-source-codes/ Something about StockSharp's source codes. 2019-02-05T18:53:13+03:00 2020-04-22T05:53:38+03:00 Yury Basangov https://stocksharp.com/users/7/ firstname.lastname@example.com
Hello all!
We very often receive your messages with questions about source codes. Yes, we provide our sources and it is possible to buy it.

First of all, we offer the sources of every part of our platform: starting from charting component and single connectors and whole applications, like S#.Terminal, S#.Designer, S#.Data.

Let me repeat this again, you can buy every part of Stocksharp platform, not only listed on our page "Pricing".
Also, white label licensing allow using the sources into your own projects without additional fees, which help to save the time and budget on development

At the list below you can find every part of our platform with prices:

Connectors with full source codes

FIX/FAST connector - $6490

ITCH (LSE/NASDAQ) connector - $4990

QuantFEED connector - $3990

License for all connectors - $12400.

Connectors to trading via MetaTrader4, MetaTrader5 with full source codes

МТ4 - $1190

МТ5 - $1190

МТ4 и МТ5 - $1990
,

Cryptoconnectors with full source codes:

Any cryptoconnector on your selection - $2500

All cryptoconnectors - $12400

StockSharp applications with full source codes

S#.Shell - $590

S#.Matlab - $1490

S#.Designer - $9900

S#.Terminal - $9900

S#.Hydra - $9900

S#.API compomemts with full source codes

S#.API - charting component - $3750

S#.API - visual designer component (used in S#.Designer) - $2990

S#.API - tabels, panels - $2500

S#.API - any proprietary connector on your selection (for example InteractiveBrokers, LMAX) - $1190

S#.API - all proprietary connectors - $4900

S#.API - $12400

All StockSharp source codes: connectors, applications, components - $74000

If you are interested in buying any part os Stocksharp source codes email us on: email@example.com

 https://stocksharp.com/articles/11684/Trading-for-beginners-Stock-market/ Trading for beginners. Stock market. 2020-04-21T21:51:00+03:00 2020-04-21T21:51:00+03:00 Marat https://stocksharp.com/users/101940/ email@example.com Today's article will not be quite ordinary.
We often write articles relying on the fact that most users have experience in trading on the exchange. However, among our readers, there are more and more people who do not have knowledge about the exchange, brokers, the market and trading in General.
We would like to change this and tell you a little bit about the structure of trading, so that everyone, even a beginner, has an idea of what they might face.
This will not be a manual for dummies, it will be an article that helps the user who first came to trade navigate.

First, let's tell you what the exchange is and how it works.

The exchange is a fundamental link in market trading.
It, like any commercial enterprise, is a legal entity and its activities are regulated by regulations and legal acts established by the state.
An exchange is a mechanism through which various market participants interact, which are consumers of various financial instruments, such as: currencies, raw materials, and securities.

As mentioned earlier, the exchange's work is strictly regulated, so we can firmly say that its work is strictly ordered, namely:
- Trading is not chaotic, but orderly, strictly at a set time, with strictly set instruments,
- Trades are held strictly in a designated place or on a strictly approved virtual trading platform (electronic exchange),
- The requirements and terms of trade for each exchange are unified, which makes it possible to comply with the procedure for transactions, requirements for the quality of goods or services provided, depending on the type of exchange,
- The trading mechanism is carried out through counter offers of purchase and sale by interested market participants.
The purpose of the exchange is to organize and regulate the markets of the financial instruments that it represents. The exchange regulates the supply and demand process in order to equalize prices and protect the interests of all trading participants from various negative price changes.

Today, there are a huge number of exchanges, each of which trades various financial instruments. You can see the choice of a variety of trading platforms when working with trading programs. For example, S#.Terminal allows you to select the trading platform that the user needs, including a large number of electronic exchanges.

This abundance is both positive, as it leads to increased trading opportunities, and negative in terms of the complexity of the choice for the novice, although the latter is rather subjective, since later, the trader understands the trading technique, gets the opportunity for more flexible trading.

The emergence of the first exchange in the XV century, we owe the Belgian city of Bruges. It was on its Central square that the first auctions of securities – bills were held.
Not far from the place of trade, the house of the Van der Beurse family was located. Later, these trades were taught the name Borsa, which over the years was transformed into the word "stock market" or "exchange". .
What are the rules for trading on the stock exchange:
- Transparency and openness of operations,
- Free pricing
- The state does not interfere in the course of the auction, but the auction is regulated by law.
- Along with manual trading, it is possible to use automated trading systems. For example, such as S#.Shell, MT and others,
- The exchange receives income from Commission on transactions.

Trading opens up great opportunities for the participant to earn money.
Today, both an experienced trader and a novice can become a market participant.
The abundance of trading exchanges allows you to choose what and where to trade. The largest exchanges include: Chicago, Tokyo and Sydney commodity exchanges, the new York cotton exchange, the London metal exchange, the German futures (Frankfurt) and Singapore currency exchanges, the European-American NYSE-Euronext, the St. Petersburg and Moscow stock exchanges.

Becoming a trader is not always as easy as the advertising brochures promise, the player's path is thorny and inevitably involves losses and winnings. Of course, with experience and knowledge, a trader acquires a stable income, but at the same time does not stop learning and improving.
A trader studies the market, various trading terminals, and SOFTWARE.
Becoming a trader is real, but it is not always as easy as it seems.
Therefore, we have developed a training course for creating trading systems, which is designed for both knowledgeable traders and beginners. We have included a full range of training in algorithmic trading and the creation of trading systems, programs and examples of trading strategies.
The goal of the course is to make trading more accessible and understandable, to teach anyone to trade, and success now depends only on the trader and his desire.
In the following articles, we will tell you how to choose a reliable broker and what a trader may face while trading. We will be happy if you share your experience and ask questions. Thanks https://stocksharp.com/articles/11629/Trend-and-countertrend!-Dont-choose-to-use-it-together/ Trend and countertrend! Don't choose to use it together. 2020-04-14T20:34:27+03:00 2020-04-14T20:34:27+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com Previously, we have already discussed various trading methods that can be used when trading, in order to increase its profitability.
For most traders, following the trend is a sign of the correct approach to trading at the moment. Like saying: "Following the trend is already 50% successful trading". There is hardly a player in the market who will deny this statement, especially if the trend is turned in the right direction for the trader, he gets a guaranteed profit.
The trader's desire to extract the maximum profit is aimed at finding a point of entry into the market when the price is either minimal for buying the desired asset, or maximum for selling the existing one.
To determine such points, a trader often needs not only a flair, which is generally one of the most important qualities, but also the ability to use complexes from a combination of trend and counter-trend strategies.
In the market, there is always a kind of confrontation between trend traders and counter-trend traders, using pullbacks and local changes in market trends.
The key to success and, as a result, getting the maximum income, is to merge these two strategies in a combination of experience and trader's flair.
However, it is worth noting that even a less experienced market player can trade using a combination of these strategies, just using automated trading systems and trading robots. For example, such as "Mr. Hyde" from StockSharp, which allows even a less experienced trader to use the movement against the trend, in order to increase revenue.

What is the combined method of trading?
The basic rules are the basis for this method:
1. Finding a way to determine a long-term trend or trend on the chart.
2. Determining the opposite counter-method that allows you to determine the pullback signal, as well as a short – term trend change in the opposite direction-determining the counter-trend.
There are various methods for determining points of entry and identifying subjectively correct methods of determination. Often, these methods seem quite complex to novice traders, but when you look at them in detail, they are quite accessible.
Let's look at one of the ways.
First, we need to identify long-term trends in the market. To do this, we will build a price chart and a moving average chart with a period equal to 200. You can build such a graph using the S#.Designer program, using the tools provided in it.

This method is very common among analysts, and allows you to determine long-term trends in the market.
His idea is that if the price is located above the indicator line, the market is growing, and if it is lower, the price is decreasing.
This indicator line is a General indicator of the market trend. Now, to determine the entry points to the market, we add two more averages, using periods of 10 and 30 days.

What is the point?
In cases when the ten - day moving average will be above the thirty-day one and above the main two-hundred-day one, we can talk about a stable UP-trend.
UP-TREND is one of three types of trend, which is a sequence of rising lows or highs of prices. it is a series of consistently rising lows and highs of prices. In other words, UP-TREND shows price growth over a period of time. It is also called a bullish trend in the FOREX market.
If the situation with the moving average is the opposite, and the ten-day moving average is below the remaining two, then we can talk about a downtrend, or as it is commonly called a bearish trend.
A change in the direction of the trend can occur over a long period, and there may be an error in the form of a delay. In order to avoid this, you can use a counter-trend indicator.
Each user chooses such an indicator for himself, focusing on the convenience and technical capabilities. For example, to get market data, although the latter problem is solved using the same S#.Designer or Hydra, which downloads market data online.
For example, we will use an oscillator that will cross the zero line. For example, consider the graph below.

So, let's determine the points where the long-term trend is changing and where you can make an entry to the market. By placing the charts together, or combining them, we can determine the points at which we could enter the market. These points are shown in the graph below.

As you can see, this method is quite simple to work with. However it has its drawbacks:
- You need to understand that the method shows repeated signals, and it may turn out that the point that the trader has identified for entry may be a trend reversal.
- It is important to understand that any method can not be considered a fully automatic method and requires the intervention of the trader, and trading robots simplify the work of the trader, but also depend on its settings.
The General conclusion is simple: trading using a combined trend and counter-trend method allows the trader to increase their income by using the direction of market movement.
A trader should rely not only on trading systems and trading robots, but also on their intuition and knowledge, which together make it possible to increase profits. https://stocksharp.com/articles/11594/S-Data-download-market-data-in-two-steps/ S#. Data-download market data in two steps. 2020-04-08T20:22:45+03:00 2020-04-08T20:22:45+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com Good afternoon.
We continue to talk about StockSharp's products, and in past articles we have analyzed the S#.Designer trading robot constructor, as well as the S#.Shell graphical framework, which helps you create trading robots, including in C# using the S#.API library.
The work of these programs is aimed at creating trading systems using programming languages or cubes, in which the lines of code are replaced with cubes for simplicity, performing trading operations or responsible for conditions and parameters.
Creating trading robots would not be complete without testing the newly created trading strategy. To test and debug trading robots, before launching on real trading, you need to conduct testing on market data to make sure that they work correctly, consider possible "thin spots" or errors that occur during trading.
Today, market data plays an important role not only for technical analysis of trading systems, but also for analysis of market behavior in General. Agree that having data on market behavior for the period of interest, under the appropriate conditions, you can accurately predict the behavior of the market, thus you can predict the development of events.
Today, market data is the most valuable information for a trader, and its search is necessary for him, both for future trading and for analyzing the actions performed.
The problem with getting market data is the small number of sources that provide information on favorable terms.
There are always restrictions for teaching, either the data is paid, or it is limited to the period for which it is provided. Moreover, the trader receives data from only one source, and changing sources to get other data is quite an inconvenient procedure.
Based on the needs of the trader in S#, we developed the S#.Data or just Hydra.
What is she setting up?
The S#.Data is a program for automatically loading market data.

The user is provided with a huge Arsenal of functions:
- Select the source of market data (more than a hundred sources to download).
- Selection of the necessary financial instrument that is of interest to the trader.
- Select data type: candles, tick deals and glasses
- An impressive selection of timeframes for downloading market data.

A huge advantage of Hydra is the ability to choose the data storage format. Thus, after downloading market data, the user saves it in a convenient format and can use it when testing their strategy on any platform. Data can be saved in two formats: in the special S#.Data (BIN) - binary format, which provides the maximum compression rate, or in CSV text format, which is convenient when analyzing data in other programs.

All the user needs is to configure the source of market data, select the tool and the required period. In this case, you can configure the program to continuously save market data.
The ability to use server mode allows you to save market data on the server and configure access from anywhere in the world, which allows you to create huge amounts of data for more detailed analysis or use in long-term auctions.
At the same time, S#.Data can use both historical and real-time data sources (for example, connecting SmartCOM to get glasses). This is possible by using an extensible (plug-in) source model.
Also, Hydra is a plugin that allows you to develop your own sources.
The ability of the Analytics function allows you to analyze data according to various criteria without leaving the program. Plotting the data of stock quotes and indexes, make the downloaded data more visible and more convenient to use.
A very important advantage that makes this program unique, in addition to a set of features that any other program can envy, is that the Hydra program is completely free.
All these features are not the limit of functionality, only bright distinctive features that make Hydra an indispensable tool for any trader who is especially set up for profit. https://stocksharp.com/articles/11569/SDesigner-is-a-simple-way-to-start-a-successful-trade/ S#.Designer is a simple way to start a successful trade. 2020-03-31T19:05:01+03:00 2020-03-31T19:05:01+03:00 Marat https://stocksharp.com/users/101940/ email@example.com More recently, we have reviewed a program such as Shell and the API library.
Of course, mastering the skills of programming trading strategies opens up huge horizons for the user not only as a trader, but also as a Creator of trading robots for sale.
However, not every user is interested in programming, and not every user is willing to spend time studying libraries.
Not every trader wants to learn how to write custom trading robots and often wants to create trading strategies for themselves.
Agree, it would be cool to have a program that can use ready-made components to create trading strategies.
S# understands this and has created a trading robot constructor that allows you to create trading robots using dice-Designer.

Now many people will start thinking: "What is it good for?".
Actually -.
First, it is more intuitive, meaning that it is easier for the user to navigate the program interface.
Secondly, the program is completely free, which allows the user to start working with it without investing a penny!
Third, the program integrates with all our products, such as Hydra, and moreover, it is able to download market data itself.

In General, the ability to download market data yourself is a huge advantage.
The user can use not several programs, but one to test the created trading strategies.
The interface is intuitive, and makes it easy to adapt to the user's environment.

What is a Designer?
Designer is a completely unique program. It differentiates strategy elements into the simplest elements, as in the constructor, and allows you to assemble a trading strategy from these elements.
The large functionality of dice allows you to create the simplest and most complex trading strategies. All you need from the user is to select the strategy functionality.
Cubes are divided into sections that include groups of cubes for the user's convenience. This allows to improve the understanding and interface of the program. However, the program prevents errors from occurring at the strategy design stage. in other words, if a cube contains data of one type, it will not transmit data to a cube with data of another type, which helps avoid errors.

This means that the user does not waste time identifying the causes of the error at the program development stage.
In General, the development stage is a separate Chapter. At this stage, the user is provided with all the tools for working out their strategy, from the functionality of dice, to the ability to integrate their elements and analyze the progress of strategy development step by step.
Back test is a convenient function implemented in the program. Step-by-step review of strategy execution using the stop button allows you to detect an error at any stage. Of course - this saves time, which in turn reduces the user's expenses.

More experienced users can create their own elements in C#. All you will need to do is create your own element, where the user saves their code. These elements and strategies in General work much faster than strategies written in the visual designer, which gives the user an incentive to develop at the same time, without changing the convenient development environment.
The advantage of strategies in C# is not limited when creating them.you can describe any algorithm and add standard operation cubes to it if you want. The strategy creation process takes place directly in S#.Designer or C# development environment (the most popular development environment is Microsoft Visual Studio), using the library for professional development of trading robots in C# and S#.API.

Speaking of Designer, we can say that it is a progressive product. The ability to include your own codes in software solutions allows you to expand the range of Designer applications. The possibility of testing reduces the potential risk. The ability to download and use it for free-makes the product available to anyone.
It just remains to start working https://stocksharp.com/articles/11542/Market-data-timeframe-tick/ Market data, timeframe, tick. 2020-03-24T21:14:24+03:00 2020-03-24T21:14:24+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com Today we are looking at a very important element of exchange trading, without which the trade itself would not make sense, since without information about the positions of trading instruments, trading would turn into chaos.
So quotes of exchange elements are data that allows market players to know in real time any changes that occur with trading instruments. Changes in price, volume, and other information contained in the exchange quotation.
The exchange quotation plays a major role in the analysis and testing of trading strategies. Getting market data of stock quotes is the key to correct testing of the trading robot. Sometimes getting market data is burdened with conventions: paid content of resources, limited data period. However, the Hydra program allows you to download market data from a huge number of sources for free, as well as the Designer program, which is clearly shown in our tutorial video.

In addition to the information that market data carries, the important value is the selected data timeframe.
What is a timeframe?
Timeframe — the time interval used for plotting stock price charts.
Its main task is to allow you to visualize graphically the trend of changes in the parameter of the exchange quotation. For example, you can see how the price changed over equal periods of time.

Let's consider the main element of the timeframe – candles. Candles are formed within the time period set by the trader, so we can see how the price changed during the week or during the day.
A candlestick chart can give information about the maximum and minimum for the period set by the timeframe, and show changes in the volume of quotes. they can tell us about the maximum and minimum prices for the corresponding period, and we can use them to see the opening and closing prices.

At the same time, to get a more detailed movement of parameters within the timeframe interval itself, you need to use tick data, from which the chart is also built. The tick chart is the most accurate, since it gives a detailed change in data, not the final one for the period.

Let's look at how timeframes are designated:
M-means a minute (for example, M4 is a five-minute time frame).
H-indicates the hour (for example, H1 is an hour timeframe).
D-means day, sometimes the value "Daily" is used (for example, D10 is a ten-day timeframe
W-means week, and the term Weekly is also used (for example, W2 is a two-week timeframe)
MN-means monthly, it can also mean Monthly (for example, MN3 – a three-month timeframe).
Y-indicates a year (for example, Y5 is a five-year timeframe).
Older timeframes consist of younger ones, so for example, you can create a ten-minute timeframe from two five-minute ones.

Different timeframes can be used for different purposes:

Minute and hour time frames:
Often used for trading method of scalping, derating, scalping.
Short timelines are used for faster trading, often limited to one trading day.

From hourly to daily timeframes
They are often used for medium-term trading. The most moderate trading speed, it is often chosen by novice traders.

From daily to annual timeframes.
For the most part, these timeframes are used by investors who place their capital for a longer period, with the prospect of generating income in the long term.

So, we have considered the main types of time frames. Of course, successful trading consists of using different timeframes. The combination of them gives the most optimal solution for increasing the trader's income. This is why all our products from Designer to Shell can work with different timeframes, and Hydra allows you to choose several timelines for downloading at once. https://stocksharp.com/articles/11483/SAPI-and-SShell-is-your-step-in-trading/ S#.API and S#.Shell is your step in trading. 2020-03-17T20:31:25+03:00 2020-03-17T20:31:25+03:00 Marat https://stocksharp.com/users/101940/ email@example.com 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's 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.

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.

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.

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's 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's 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's 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's 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's 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?

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.

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's 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).

- 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.

- 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's costs and allow you to start trading immediately. https://stocksharp.com/articles/11471/Pyramiding-in-trading/ Pyramiding in trading 2020-03-10T22:39:46+03:00 2020-03-10T22:39:46+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com Earlier in the articles, we considered such mechanisms used in trading as Stop-Loss and Take Profit. Of course, these two tools help reduce the risk and increase the profitability of the strategy. But what if, because of them, we limit ourselves to getting more profit?
To understand how this can be done, you need to consider Pyramiding.
What is pyramiding - оne of the types of strategy aimed at increasing capital by step-by-step opening of several transactions with a favorable trend. Using this strategy allows the trader to get a stable income.
Let's consider the principle of pyramiding.
The essence of pyramiding is that after the profitable result of the last transaction, the trader opens a new position, while doubling the bid, compared to the previous one. As for the risk arising from the next bid, it is equal to the sum of the profit of the previous stage and the initial bid. At the same time, the amount of profit depends on the so-called "steps" of pyramiding, and it grows exponentially.

Pyramiding is applicable in any market – stock, currency, and others. The trader adds a new position to the previous effective one, if the trend direction is profitable for him.
If the trader's actions are calculated correctly, he will always be in profit. The use of various trading robots also contributes to a more convenient use of pyramiding. For example, "Mr. Hyde" from StockSharp, which in automatic mode and flexible configuration can trade in pyramiding mode.
An important point is that the trader must be sure that the trend is stable, otherwise it can lead to losses. However, the use of automated programs, such as Designer, which use condition cubes and position protection, makes trading with pyramiding minimally risky. An example of this strategy is shown below.

Let's consider the basic rules of pyramiding.
- Constantly monitor the ratio of return and risk within 1 to 2, so that the previous yield can cover the current risk.
- All parameters used during trading must be calculated in advance before entering the market.
- Use pyramiding only on a stable trend.

Let's look at an example of using pyramiding.
Let the trader have a capital of $10,000. At each main level, it can buy 10,000 units of the selected currency. In the Forex market, this is 1 mini lot. The amount of profit at each stage will differ, however, the size of the set Stop-Loss for each opened transaction will be equal to 50 points.
So, the trader buys 10,000 units of the base currency. Let's assume that the market situation is shown in the figure.

The price rises and breaks through the resistance level, now this level becomes the support level.
Let a bullish pin bar be formed at the support level (a graphical analysis figure based on the non-indicator method of trading, as well as the analysis of Price Action charts), in consequence of which the trader decides to buy 10,000 units of currency. When a trade is opened, the trader sets the Stop-Loss at 50 points or 1% of the risk of capital.

This way the trend keeps its direction, and the trader trades further. The trend breaks the next level, and the price is set above the support level, and the trader buys another 10,000 units, and the previous Stop-Loss is transferred to the new level.
The same situation is when the price breaks the third level

Thus, the trader accumulates a long position of 30,000 units of the main currency by the third stage. There is almost no risk, since at the third stage, when a deal is concluded for 10,000 units, the profit will be 4% if the trend reverses.

The potential profit, with a successful outcome, can be 12%.
Let's look at this example in numbers.

It is important to see how the possible profit increases from each stage to the next, while reducing the risk
The trader's first trade will bring him a profit of 6% of the initial capital.
Consider all the situations in the market:
- First transaction: 10,000 units
Negative: there was a -1% loss
Positive result: +6% in profit

- Second transaction: 10,000 units
Negative result: no loss (+2%in profit from the first stage and -1% in loss from the second)
Positive result: +10% in profit (+6% in profit from the first stage and +4% in profit from the second)

- Third transaction: 10,000 units
Negative result: +4% in profit (+3%in profit from the first stage, +2% in profit from the second stage and -1% in loss from the third)
Positive result: +12% in profit (+6% in profit from the first stage, +4% in profit from the second stage and +2% in profit from the third)

As you can see, the risk is about 1%, while with positive trading of all three stages, the profit will be 12%

Main advantages and disadvantages of building:
Plus:
- Pyramiding strategy allows you to increase your income with minimal risk;
Minus:
- The strategy is quite complex and requires experience. It is possible to use the strategy for medium or long periods of time, preferably using automated trading systems. The correct calculation of the exit point from pyramiding, analysis and testing of the trend behavior is of great importance, which necessarily leads to the use of trading robots. Pyramiding is not suitable for scalping strategies, and is also aimed at long-term trading.

Pyramiding is a profitable and relatively safe method of trading. Its reliability has a downside in the duration of the process, the accumulation of sufficient experience and knowledge in trading that would correctly calculate the levels of trade. Also, this type of trading is not suitable for all traders, so choosing it as the main one should be conscious. https://stocksharp.com/articles/11449/What-is-Stop-Loss-and-Take-Profit/ What is Stop-Loss and Take Profit? 2020-03-03T11:53:25+03:00 2020-03-03T11:53:25+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com 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, 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.

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.

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's 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's server, through which the trade is carried out, and is sent only when the necessary condition is reached.

Let's 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's 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's sale price.

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. https://stocksharp.com/articles/11436/Forward-contract-The-essence-and-its-types/ Forward contract. The essence and its types. 2020-02-25T14:36:23+03:00 2020-02-25T14:38:18+03:00 Marat https://stocksharp.com/users/101940/ email@example.com Previously, we considered such instruments as futures and options, which are exchange-traded instruments. However, there are also non-exchange instruments.

Forward or forward contract – a contract (agreement) under which the seller must transfer the underlying asset specified in the contract to the buyer within the period specified in the contract or perform an equivalent monetary compensation.

The buyer undertakes to accept and pay for the asset, on the basis of which the seller and the buyer determine the financial obligations determined by the size of the indicators of the underlying asset, at the time of their execution, in accordance with the procedure specified in the forward contract.
In essence, a forward contract is a bilateral agreement on the acquisition of a basic asset, drawn up in accordance with the established form. The forward establishes obligations of one party to the other party to sell or buy an asset at a certain time and on accepted terms, the price of which is fixed and set by the terms of the contract.

We can say that a forward is a binding contract that has its own term of execution set by the parties (buyer - seller), an established asset and its volume, as well as a fixed price for this asset at the time of execution.

Let's look at what conditions should be set in the forward contract:
- The subject of the forward contract or the asset being sold in the forward contract. Such an asset can be: a commodity, various financial instruments;
- The volume of the asset, the volume to be delivered, and the volume is specified in the corresponding units of the asset;
- The date on which the asset should be placed. The date is fixed and cannot be changed;
- Execution price of the forward contract. Amount to be paid;
- Forward price. Differs from the fixed price specified in the forward in that it is variable and is determined at the current time as the current price of forward contracts for the corresponding asset.

Let's consider what features a forward has:
- Forward contracts are concluded outside the exchange, for example, in contrast to the option or futures;

- The forward period can be set by anyone determined only by the parties to the contract;
- Forward contracts do not have strictly defined forms;
- There is no need to submit reports on forward contracts;
- The forward contract cannot be terminated or changed;
- Can be compiled in a convenient form for customers;
- A forward contract is not retroactive;
- There is no Commission for drawing up a forward contract.

Pros and cons of forwards.
Speaking about the positive aspects of forward contracts, it is worth highlighting the following points:
- Fixed price on the execution date;
- No commissions for concluding contracts.
The negative point is that when the forward price changes relative to the settlement day price for it, the contract participants do not have the opportunity to terminate the contract.
In fact, the participants there is no possibility of maneuver, not the flexibility of the terms of the contract, does not allow to change the terms of the forward contract.
Low liquidity caused by the lack of a secondary market for forwards and as a result the ability to resell the contract.

What is the difference between forward contracts:
- The forward is mandatory;
- The contract is drawn up taking into account the requirements of the transaction participant;
- Before the final conclusion of the contract, the following parameters are determined: forward volume, quality characteristics of the asset, delivery time and place of delivery.

Let's look at the main types of forwards:
- Delivery forward. It ends with the delivery of the underlying asset and payment in accordance with the terms of the contract;
- Non-delivery or settlement forward. The forward does not end with the delivery of the underlying asset;
- Foreign currency forward contracts. In this type of forward, the parties exchange currency with a fixed rate under the contract.

Forwards are divided by the underlying asset:
- Commodity forward, which implies tangible assets for purchase and sale (oil, gas, metal, agricultural products);
- Financial forward, which means financial instruments (currency, interest rates, shares, and other securities) as an asset.

There are forward contracts on the sides of a forward transaction:
- Forward contracts between banking organizations or the Bank and the client;
- Forward contracts concluded by the manufacturer and seller of any product.

Hedging mechanism for forward contracts.
We told you earlier that hedging is an operation to reduce the possible risk that occurs when entering into contracts caused by fluctuations in market prices. We also talked about tools that help you perform hedging operations, talking about the trading robot "Hourglass" and using the set of functions of the Designer program.

Most often, forwards hedge these types of risks:
- Currency exchange rate caused by fluctuations in the exchange rate of various currencies;
- Interest rate due to changes in securities quotations;
- Product, due to the movement of the prices associated with inflation, political and different factors that affect the economy.

The use of a forward in operations is primarily an insurance against the changing market situation. Well-chosen forward conditions can give its participants the opportunity to protect themselves from adverse situations in the market. However, not very flexible forward conditions make it a little liquid, although it remains a fairly popular tool. https://stocksharp.com/articles/11418/What-are-futures-and-options-and-how-to-make-money-on-them/ What are futures and options, and how to make money on them? 2020-02-18T14:05:15+03:00 2020-02-18T14:06:27+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com Today, the concept of futures and options is one of the most frequently uttered in the market. Let's get acquainted with these financial instruments, give them concepts and consider the mechanism of their use.
Futures and options are derivatives, and they are also called derivatives. When buying these financial instruments, the trader does not get the asset itself (stock, bond, etc.), but a contract – an opportunity to perform a purchase and sale operation in the future, at a fixed price. Simply put, a derivative is an insurance that protects the trader from possible adverse fluctuations in the price of the main asset

Little history.
Initially, derivatives were created to reduce the possible risks of producers of certain assets in the form of goods.
Let's look at a simple example:
Company A produces flour, which is its basic asset.
Today, on the conditional market, company A can purchase a contract for the sale of 10,000 tons of flour for $100, with a sales period of 3 months.
In fact, after 3 months, company A can sell its flour for a fixed $100, despite the fact that the cost of flour may fall to $80. With this contract, the company predicts and fixes its income, which will be $1,000,000, and the contract is called - futures, a contract "for the future".
There is a possibility that the cost of flour will increase to $120 per ton, and in this case, company A will receive less than $200,000, since the market value of 10,000 tons of flour will be $1200,000.
The buyer of such a contract can be company B, which is engaged in the production of bread, and therefore the market price of flour is also important for it.
A private trader needs derivatives in order to get a fixed price of a purchase and sale transaction, such as a stock or currency, as well as an asset that cannot be purchased by a trader, such as oil.

Let's talk about which futures and options are the most popular in the world right now. Today, the most" popular " are derivatives for currency, stocks, precious metals, and oil.
It is worth saying that a little more than 10 years ago, the purchase of a futures contract meant the delivery of a real asset, that is, in our case, the delivery of flour. Today, the lion's share of derivatives are non-deliverable, and on the day of the end of the contract, counterparties are paid in money.

Let's look at the mechanism in our example.
So by the end of the contract, company A must receive a fixed $ 1,000,000 under the terms of the futures contract, which must be paid by company B.
Since their derivative is non-deliverable, at the end of the contract period, company A will not supply flour to company B.
What's going on? Company A displays the tonnage of flour on the commodity exchange, with the possibility to sell it to any company, including company B. the tonnage is received at a warehouse accredited by this exchange.
At the same time, company B has the opportunity to purchase its 10,000 tons set by futures from another company and receive them at another warehouse accredited by the exchange.

The price of flour may change, and may not be equal to the set price in the contract.
- Let the price drop to $80 per ton. In this case, company A sells its asset at $80 per ton, receiving $800,000, and the remaining $200,000 is paid to it by company B, so in total, company A will receive $1,000,000.
At the same time, company B will buy 10,000 tons of flour for $80 from another supplier, spending $800,000, and with the amount of future compensation paid to company A in the amount of $200,000, its total expense will be $1,000,000, as planned.
- If the cost of flour increases to $120, in this case, the difference will be paid by company A to company B.

Many novice traders have a question about the possibilities of trading options and futures in various markets, for example, stocks and bonds.
The answer is Yes. However, there are restrictions related to the duration of such contracts.
In our example – 3 months. If the contract was conditionally concluded in June, it ends in September.
The value of a derivative always depends directly on the value of the underlying asset, and the value of both instruments tends to be equal. Because of this dependence, futures and options are called derivatives.
Traders earn money using derivatives, for example, on arbitrage transactions, but at the same time derivatives do not cease to play an important role in hedging operations – insurance of transactions.

Let's take a closer look at the features of both financial instruments.
Let's start with futures. Futures a contract that involves the sale of the underlying asset at a fixed price, with a set delay in execution-payment. Futures fix the purchase or sale price of the underlying asset at the expiration of the term, and the market value of the asset may change.
If the futures contract is non-deliverable, then only monetary payments between the parties to the contract are made on it. It is worth saying that the delivery of the asset does not necessarily have to be made on time, in other things, as well as the purchase, but in this case there is a probability of price changes, and the risk of loss of profit.

Consider the mechanism for concluding a futures contract.
The contract is concluded exclusively on the exchange. The seller puts his offer on the exchange with its price, volume, and due date. After a buyer appears who agrees to these terms and conditions. The seller can also choose a ready-made request from the buyer, which has a set price, volume and deadline for execution.
This list of applications is always present on the exchange, and applications often differ little. Any of the participants in the transaction sees this list and chooses the most suitable one for them according to the condition. This list is called a glass and is displayed in the program that traders use. The greater the depth of the glass, the more flexible it is possible to enter into contracts, viewing more offers and as a result choosing the most suitable conditions in the case of the buyer, and at the same time more likely to conclude a contract in the case of the seller. Some trading programs allow you to set the depth of order book, for example, Terminal, where you can set your desired depth. The order book in the Terminal program is shown below.

Obligations to execute futures are transferred to the exchange.
When the date of execution of the futures contract and the conditions under which the seller will be obliged to pay remuneration (if the price of the asset has fallen), the exchange itself transfers the amount to the seller's account and withholds this amount from the buyer's account. If there is a situation that the buyer's account of the contract does not have the necessary amount, then this will be a problem that will be solved by the exchange, not the seller.
The situation is the same in the opposite case if the seller must pay compensation to the buyer.
The exchange carries risks, so before entering into contracts, both parties make a cash Deposit calculated according to the exchange's formula. Most often, its value can be double the size of the fluctuation of the futures price in one day. So if the price fluctuation was 3 %, then the collateral may be 6% of the price of the futures contract.
The Deposit is refundable, and is returned to the account of the parties after the execution of the futures. If the participant refuses to fulfill the contract, the Deposit will be deducted from the exchange's account as compensation.
Sometimes there is a need for early termination of the contract, in which case its value will be equal to the value calculated by the exchange on the day of termination. That is, the exchange calculates the price of the contract on a daily basis, while it uses its own rules for calculating the cost, but focuses on the prices that are offered on the market by bidders.
As mentioned earlier, the price of the futures is slightly lower than the value of the underlying asset, but the difference is small. Sometimes there is a short-term gap that is associated with market situations, which allows you to earn using an arbitration transaction.
You can also make money on futures during the day. So the exchange recalculates the price of the futures, respectively, every day, when its price increases, it charges the difference between the value of the contract and its current value, while the amount of collateral also increases.
When the contract execution time comes, the price of the futures becomes equal to the market value of the asset.
In General, we can say that a futures contract is a convenient financial instrument that allows you to reduce financial risks. At the same time, speculative operations with this tool are quite complex and, often, it is possible to make money on them using automated tools, such as trading robots. For example, the trading robot "Edward".

The next financial instrument is an option.
This is also a contract, but not for the amount of the sale or purchase, but for the opportunity to buy or sell the underlying asset at a fixed price at a specified time.
By type of transaction options are:
- Call option – an option to purchase;
- Put option – a sell option.

Option contracts are also traded only on the stock exchange.
The participant who bought the option has the right to refuse the transaction at any time if it is not profitable for him, while the seller of the option has no right to refuse it.
Thus, if the buyer uses the right of the transaction, the seller is obliged to fulfill it.
This condition makes this financial instrument very difficult for an inexperienced user, and allows him to trade confidently using various trading robots or trading systems, coupled with the ability to predict possible market situations.
An option can be said to be insurance against possible losses. In case of refusal, the buyer loses an amount equal to the value of the option, which is insignificant in comparison with possible losses. This amount is the seller's premium.
Considered example:
Trader A purchased 100 shares of Trend LLC at $10 per share. He plans to sell these shares in 2 months.
Trader B offers him an option contract for the sale of 100 shares of the Trehd LLC, with a period of 2 months for the price of $15 per share. The option price is $100.
Let's assume that the transaction took place, let's consider two possible scenarios:
- Let's assume that the price of the Trend company's shares fell to $7 per share by the time the option was exercised. In this case, trader A will not only not lose, but also earn.

$1500 (optional sale) - $1000 (initial costs) - $100 (seller's premium) = $400 -profit

.
- Let's assume the share price has increased to $17 per share. Thus, the trader had to waste $100 on the purchase of the option.

$1700 (optional sale) - $1000 (initial costs) - $100 (seller's premium) = $600 -profit
.

And without the option, the profit would have been $700.
An option, like a futures contract, is a non-deliverable contract. If the buyer uses the option, the seller will simply pay the difference between the current price of the asset on the market and the option price.

As mentioned earlier, trading on the stock exchange using options is quite complex, and a market participant needs to be able to predict situations. For call options, you must set a price that will be lower than the expected price after a set period, for a put option, on the contrary, higher than the expected price.
Option prices are calculated using statistical data on fluctuations in the asset value. Many users are helped in this by various programs, trading strategies, and trading robots that calculate situations using market data. which for example can be obtained in Hydra.
The one who sells the option is exposed to greater risk, its profit is the value of the option, and the loss is unlimited, as it depends on the price fluctuation.
Any transactions with derivatives are associated with various risks. The task of the trader is to choose the optimal solution, including the choice of an asset, a trading platform, a strategy, and a trading robot. Manual trading does not bring the necessary income on speculative transactions, so working with trading robots makes the trader's work profitable if the conditions are chosen correctly. https://stocksharp.com/articles/11401/Hedge-The-essence-and-its-types/ Hedge. The essence and its types. 2020-02-11T11:59:47+03:00 2020-02-11T12:01:29+03:00 Marat https://stocksharp.com/users/101940/ email@example.com Unfortunately, insurance companies do not provide traders with insurance in case of adverse price changes in the market. However, the so-called insurance mechanism exists, and is implemented through the futures exchange.
This insurance mechanism is called Hedging.
Hedging is an option for insuring assets against adverse price changes in the market, in which a trader buys an opportunity to buy and sell an asset (futures) in a subsequent period of time with fixed terms of the transaction. The name originates from the English hedge, which means insurance or protection.

Hedging uses the futures market, which reduces the risks of an adverse trend change in this market, in fact, a futures transaction is a replacement for an upcoming transaction in the cash market, while the futures position has the opposite direction of the position in the cash market, thus reducing the risk.
For example:
The wheat producer is confident that its future crop will bring it profit in three months.
Provided that all farms get a good harvest, the price of wheat will decrease in the market. To reduce the risk – hedging the risk, the wheat producer buys a forward contract (not a standardized contract for the delivery of the underlying asset in the subsequent period, with the fixed price of the underlying asset), under which it will be able to sell 10 000 tons of grain at a price of $200 per ton.
Now let's look at the possible scenarios:
- Let the harvest turned out good, respectively, the price on the market sank to $150 per ton. In this case, the manufacturer executes its forward and earns:
$200 x 10 000t = $2000000-that is, it remains a winner;
- Let the crop was born bad, while the price rose to $250 per ton. The manufacturer performs its forward, while it receives $2000000, and its losses are $500 000. In this scenario, the buyer wins, but the manufacturer has insured itself. To avoid losing more.

When hedging, a fixed-term hedging contract is opened. at the same time, this contract itself is a financial asset, so it can be bought and sold, that is, to carry out normal transactions on the market.
The asset that is insured can be any asset from your portfolio and any asset that is only expected to be purchased. The market where the possibility of operations with an asset is implemented is a spot market (transactions in such a market are made immediately, usually within two days at most).
We can say that hedging contracts form a fixed-term or future market.
Let's look at another example that examines the possibility of compensating losses from the sale of an asset by selling futures and Vice versa:
Let the organization acquire a tanker with oil, having a desire for subsequent resale. In the current period of time, it is not able to sell oil at current market prices, however, the organization sells a futures contract for oil. In the subsequent period, the organization sells oil and buys futures.
- Let's assume that the price of oil fell at the time of sale, respectively, when it is sold, the organization will suffer a loss, but the liquidation of the futures contract will give a profit that will cover the loss from the sale of the real product.
- Let's assume the situation has changed, and the price of oil has started to rise, respectively, the organization will make a profit on the sale, but the purchase of futures will bring a loss, but it should be covered by the profit received.
Thus, the loss is compensated in one market at the expense of profit in another, we can say this is comparable to an arbitration operation.
Such operations are possible because of the close relationship between the price on the real market and the futures market. Of course, we can not say that the prices in both markets are the same, since there are differences. For this reason, it is impossible to talk about an ideal hedge, in which losses are reduced to zero, but at the same time, the importance and possibilities of hedging are fully justified when trading.
Successful hedging depends on the degree of correlation of prices in the cash and futures markets, the higher the correlation, the more successful the hedging. Of course, there is a risk that changes in prices on the cash market will not be compensated by changes in prices on the futures market, which will result in a loss or profit. But this is how hedging protects the underlying risk from the greater risk caused by the insecurity of an open position in the cash market.

A market participant who insures their risk is called a hedger, and the counterparty in the hedging contract may be:
- hedger's partner;
- other hedger (buyer or seller of the underlying asset, which also insures the risk, but in the opposite direction);
- financial speculator.
The hedging strategy for participants is based on a unidirectional parallel change:
- current price of the underlying asset-spot prices;
- a prospective "futures" price.
Operation of the hedge opens two trades at the same time:
- transactions with the underlying asset on the spot market;
- transactions on the futures market of the same asset.

Hedging can be of various types, let's look at what types are:

By the type of instruments used in hedging:
- Exchange-traded instruments (futures, options), while contracts are opened exclusively on exchanges, and transactions have a third party-a Settlement Fee that tracks the performance of obligations. All contracts are independent derivative financial assets and items of purchase/sale operations.
It is worth highlighting the following positive aspects of such hedging:
- security,
- access to auctions,
- market liquidity.
The disadvantages are standardized assets, strict requirements, and various restrictions on transactions.
- Over-the-counter instruments (forwards, options), while contracts are concluded outside the exchange, are one-time, do not have circulation on the market, and are not independently traded assets.
Positive aspect:
- Large flexibility in the choice of an asset and the terms of the contract.
The disadvantages of such hedging are low liquidity with an increased risk of default, and increased transaction costs.

The next type is hedging by type of counterparty. It is divided into the following types:
- The buyer's hedge, in this case, the buyer's risks are insured, which are associated with a prospective increase in prices and deterioration of the transaction conditions. With such hedging, the most common operations are the purchase of forwards, futures, call options, as well as the sale of put options.
- The seller's hedge, in this form, the seller's risks are insured, which arise when the asset's value potentially falls and the contract terms deteriorate. This hedging involves selling forwards, futures, and call options, as well as buying put options.

Hedge by the amount of risk that must be insured, is divided into the following types:
- Full hedging, in which the entire volume of the transaction is insured.
- Partial hedging, in which only part of the transaction volume is insured.

By the time the underlying transaction is concluded, the hedging is divided into:
- Classic hedging, used with the application of a fixed-term transaction, which is concluded after the transaction with the insured asset.
- Anticipatory hedging, in which a fixed-term transaction is concluded in advance before the acquisition or sale of the insured asset.

Hedging by asset type is divided into:
- Net hedging, in which the insurance contract is concluded for the same type of asset.
- Cross-hedging, in which the hedging contract is entered into for a different type of asset than the underlying one.

Hedging under the terms of the contract is divided into:
- One-sided hedging, in which the possible loss from price changes in the market is fully borne by one of the participants in the transaction – the buyer or seller.
- Two-way hedging, in which losses are distributed among all participants.

It is worth noting that all the types of hedging analyzed allow you to choose the most optimal strategy for the implementation of the trading mechanism.
Of course, it is worth saying that this type of operation is quite difficult for a beginner, and sometimes for an experienced user, it causes a large number of problems.
Today, the use of this type of operations is facilitated by implementing hedging mechanisms in various trading systems and robots.
For example, StockSharp has implemented an "Hourglass" trading robot that allows hedging using various methods and trading operations.
For Designer users, the "Hedging" cube is implemented, which settings allow you to protect against risks in ongoing trading operations.

In this way, building strategies is easier, and is reduced to configuring the cube and input parameters.

Remember that the types of hedging considered can be fully implemented using our SOFTWARE, including the implementation of these methods is considered in the course of programming training.
The most important thing is to remember and not forget about the opportunities to save your profit, and hedging methods will come in handy https://stocksharp.com/articles/11383/Arbitrage-trading-Principles-types/ Arbitrage trading. Principles, types. 2020-02-04T18:52:36+03:00 2020-02-04T18:53:24+03:00 Marat https://stocksharp.com/users/101940/ email@example.com
What is Arbitration, general concepts.

Recently, the concept of Arbitration has been found quite often in trade. What is Arbitration?
Arbitration is a method of profit that minimizes the risk of loss by using the price difference for the same asset in different markets.
Today, this mode of trade is a commonly used trade tactic.
Let us consider what this mode of trade consists of.
The point is to sell the same asset at a higher price in one market and purchase the same asset at a lower price in another market.
Such trade is one of the most important components of the market, and most traders seek to conduct such trade, effectively reducing the possibility of loss to a minimum.
Although the nature of arbitration consists of price differences of one asset in different markets, this strategy can be applied to two assets with similar prices and portfolio volume.
Consider what the arbitration portfolio is and its properties:
- Arbitration portfolio - portfolio of assets, which does not require additional resources of the investor.
- The arbitration portfolio is not influenced by any factor, that is, has zero risk.
In fact, for an investor, an arbitration portfolio is a tool that allows it to receive a large return, while remaining unaffected by various risks.
A simple example of arbitration trade:
Suppose the value of asset A on one of the exchanges is $100, while the value of the same asset on the other exchange is $105.
A trader acquires an asset on one exchange, where its value is lower, and sells it on an exchange, where the value of it is higher. Thanks to this strategy, the trader gains profit, in the form of price differences of asset A on various exchanges.
This example is quite simplified, and is given only for the sake of clarity, in real trade the implementation of such transactions has its own difficulties.

Choice of pair in arbitration.

Let us once again define Arbitration Trade based on practical knowledge of it.
Arbitration trading is a method in which trading is carried out by means of differently directed transactions with an asset or assets having similar prices and portfolios, based on the difference in their value. In fact, the trader buys a cheaper asset and sells a more expensive asset similar to the first asset.
Often, the arbitration pair selects a base and derivative asset (for example, shares and stock futures). Both assets should have similar price dynamics - correlation.
However, correlation has the property of being broken for various reasons.
Such reasons can be related to various serious market changes and to the consequence of market inefficiency. Emerging correlation violations contribute to profit in arbitration transactions. In fact, the trader profits when the correlation of the underlying and derived asset is restored, after its violation.
Simply put, an arbitration transaction occurs when buying a cheap asset and selling an expensive asset when there is a difference between their prices in view of various factors. However, for the rest of the time, the prices of both assets tend to be equivalent.

Types of arbitration trade.

Let 's look at what types of arbitration are distinguished in trading:
- Time arbitration;
- Spatial arbitration.
Temporary arbitration implies that transactions occur with a time difference. This type of arbitration is characterized by a mechanism: buy cheap, and sell expensive, or vice versa, sell expensive, and buy cheap. To put it simply, such a mechanism is actually - a common speculative transaction made on the stock exchange market.
Temporary arbitration contains a risk, as during the period of time the trend may not change the direction of movement, that is, if the trader initially bought the asset for cheap, it is not a fact that after time the asset will not cease to be cheap, thus bringing a loss on sale.
The next type of arbitration is spatial. With this type of arbitration, a couple of transactions are bought and sold at the same time but at different sites. In such transactions risk is minimal, and sometimes at all reduced to zero, as a couple of transactions take place simultaneously, at the same time the trader should take into account not only the difference in the price of the asset, but also possible commissions, which should be included in the expenses and covered by the amount of profit.
In addition to the types of transaction time, arbitration is divided into trading methods. Let 's look at the main ones and explain them.
Spatial arbitration is divided into the following types:
- Equivalent arbitration;
- Regulatory arbitration;
- Calendar arbitration;
- Percentage arbitration.

Equivalent arbitration refers to such transactions in which the underlying asset and derivative asset (derivative) are considered. Since the price of a derivative always strives for the price of a basic asset, price schedules go alongside each other, sometimes intersecting and diverging.
If we simultaneously open equidistant positions on the selected asset and its derivative, when they have the maximum divergence, then closing the position when they converge will make a profit.
Regulatory arbitration is based on the difference in price caused by different rules in different jurisdictions (areas, countries, unions).
For example: due to certain legislation, an asset in one region is sold with a markdown, and its price is correlated with prices in other regions, differing by a stable markdown difference. In this way, by purchasing an asset in one region and selling it in another, you can earn a profit in the amount of a markdown.
Calendar arbitration is based on the difference in price arising between futures on the same asset but having different delivery times. This difference is called a calendar spread. The subsequent trading mechanism is similar to the equivalent arbitration method.
The last type is interest arbitration. This arbitration takes place on the foreign exchange market (Forex), and there are two types:
- No forward coverage;
- With forward cover.
The essence of arbitration is that the currency is bought and placed on a deposit with a set percentage. The currency is then sold at the current market rate. If the currency purchase occurs with the sale of a forward contract for the same amount, arbitration with forward coverage. With this type of risk is minimal, and for frequent absence.
If the purchase is made without forward support, arbitration without forward coverage. Such arbitration may be accompanied by a large risk based on a change in exchange value, which may result in a loss that is greater than the percentage of income on the deposit.
Triangular arbitration is also common in the Forex market. Let 's look at it with an example:
The trader buys EUR/USD, sells EUR/GBP at the same time, and buys USD/GBP. An equilibrium triangular contour is created. It turns out that the trader bought Euro for dollars, sold Euro for Pounds, Bought Dollars for Pounds. Thus, a closed chain is obtained, on the imbalance of which profit is made.The scheme of such arbitration is shown below:

Conclusions

Arbitration trade has gained a lot of recognition among traders. A large number of approaches to solving the problems of arbitration trade, a large number of methods used to implement the tasks make this kind very flexible, and the absence of risk or its minimum value further popularizes it.
However, it is worth saying that the strategies of arbitration to direct, are related to the rate of reaction of the trader to changes in the asset. This leads to various requirements that promote successful trade:
- Fractions of a second play a major role in arbitration strategies. Therefore, such trading systems require good software. It can be represented by ready-made trading robots. For example, StockSharp offers the robot "Edward", which allows you to work using the trader's arbitrage strategy and is capable of quick and flexible configuration.
High-quality software is especially important when working for Forex, as the number of traders is high. Therefore, many prefer an individual approach and create trade robots on their own through various programs. Trading robots are mostly written in powerful C# or C++ languages, using libraries such as S#.API and Interactive Brokers API.
Recent years have also received designers of trade strategies TSlab and S#.Designer, which allow to create trade robots without programming.Below is an example of a trading robot created using S#.Designer, the graph shows the moment of divergence of assets and their convergence with the subsequent transaction by the robot.

Application of the latest software leads to reduction of risks and improvement of the mechanism of work and as a result to increase of profit.
- It is important to remember that the strategy, even if there is perfect software, is profitable, if the income will exceed the possible risk and all broker commissions.
- It is worth remembering even using a trading robot, the risk can not always be reduced, so the trader must constantly manage his strategy, improve his tools and his knowledge. Learning new principles that can be applied in trading can make a trader a pioneer in making profits.
It is necessary to know that arbitration strategies can and should be combined with other types of exchange trade, which will give additional opportunities in income generation.
 https://stocksharp.com/articles/11355/FAQ-on-Aalgorithmic-trading-The-history-of-algorithmic-trading/ FAQ on Aalgorithmic trading. The history of algorithmic trading. 2020-01-27T15:09:19+03:00 2020-01-27T15:10:10+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com The start and emergence of algorithmic trading can be considered the 98th year of the last century, when the us securities Commission (abbreviated SEC), decided on the possibility of using electronic trading platforms, and as a result, the use of trading robots for algorithmic trading.

All this gave rise to a leap in technology in the field of trade.
There are several periods that are particularly important:
- the beginning of the 2000s, this period of technology allowed you to make automatic transactions in a few seconds, despite the low speed it was a breakthrough, according to the SEC calculation, robots account for less than 8% of transactions.
- the end of the 2000s was characterized by an increase in the speed of transactions up to milliseconds, during this period the number of transactions made by trading robots exceeded 55-60%.
- late period since 2010, the number of use of trading robots has decreased, and amounted to about 45-50%. Experts attribute the decline in usage to an increased number of errors and failures of trading robots.
Today, algorithmic trading (HFT trading) is one of the most important components of exchange trading. Not only private traders, but also large companies-invest. banks and funds use trading robots in their work.

The annual investment of companies in the development of tools for algorithmic trading is growing, and the result of such developments brings its own income.
StockSharp has been providing traders with all the necessary tools for algorithmic trading for many years, starting with connectors for exchange trading and ending with software that allows them to work on all trading platforms around the world.
You can find more information about the list on our website.

 https://stocksharp.com/articles/11274/FAQ-on-Algorithmic-trading-What-is-Algorithmic-trading/ FAQ on Algorithmic trading. What is Algorithmic trading? 2019-12-24T15:37:52+03:00 2019-12-24T15:41:26+03:00 Marat https://stocksharp.com/users/101940/ email@example.com The concept of algorithmic trading there are two values:
- Algotrading -an automatic system that allows you to open trades within the created algorithm, without the participation of a trader;
- Algorithmic trading – a method of execution of a large order, in which the order is automatically divided into parts, and is submitted consistently according to the established rules.

In the first case, algorithms are needed to make a profit, using automatic market analysis and opening positions. Such algorithms have other names such as "trading robot" or "Advisor".
In the second case, the algorithm is used in order to simplify the work of the trader in manual trading when making transactions in large volumes.
StockSharp company pursuing its goal to facilitate the work of the trader and bring it to a higher and more profitable level, has developed several programs to help the trader in this.
Among these programs is S#.Designer.

It allows you to create trading robots for algorithmic trading.
Our company has created a program that will help the novice trader to create his strategy with the help of dice. In fact, it is a constructor that requires a trader only to understand the market and the developed strategy, which is quite simple to implement and implement in trading processes. More information about the program can be found on our website. https://stocksharp.com/articles/11255/Interactive-Brokers-FAQ-INTERACTIVE-BROKERS-who-are-they/ Interactive Brokers FAQ. INTERACTIVE BROKERS-who are they? 2019-12-11T15:35:11+03:00 2019-12-11T15:36:01+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com Interactive Brokers is the largest broker in the United States, based on the volume of average daily transactions with profit. Interactive Brokers is a leading electronic Forex broker.

Electronic brokers are focused on trading strategies or trading robots that work in the sector of trading with commodities , this allows us to say that this broker is among the five Prime brokers.
Interactive Brokers is fully regulated by the financial industry Regulatory authority, the securities and exchange Commission, the new York stock exchange, the financial conduct Authority, and other self-regulatory organizations.
To get the data, use the API connection via the IB TWS terminal.

To work with this program, StockSharp has created its own API library, which allows you to create your own connection.
What can this give the trader? There are several advantages:
-The fastest quotes
-The average receiving speed is 4 MS
- Work with real and demo accounts
Accordingly, the use of Interactive Brokers with the help of API libraries opens up new opportunities for the trader, allowing him to expand the expansion of his trading operations. https://stocksharp.com/articles/11226/FAQ-on-Crypto-trading-rypto-trading-what-is-it/ FAQ on Crypto trading. Сrypto trading what is it? 2019-12-02T16:13:58+03:00 2019-12-02T16:14:25+03:00 Marat https://stocksharp.com/users/101940/ email@example.com Good afternoon.
Today we will consider a relatively young type of trade - Сrypto trading. What is the difference between cryptocurrency token trading and traditional trading? Traditional trading is, for example, trading in precious metals, currencies and stocks. The main difference between crypto trading and trading on the stock market is the high volatility of the exchange rate.
Traders want to get a return of thousands of percent of the transaction, but in the stock market, such transactions are extremely rare, and the time of its occurrence is large enough, they buy shares of little-known companies in the hope of increasing capitalization, which is sometimes not feasible. Below is a graph of the change in the exchange rate of various exchange instruments for several years, which shows how much the exchange rate of cryptocurrency is changing, which allows you to earn more.

In Crypto trading, fast trades with high returns are quite common. Crypto trading has the greatest similarity with Forex trading. Here, too, the value of currencies is volatile, and stock speculators earn by selling more expensive cryptocurrency and buying cheaper.
Different strategies and opportunities can be used to work in the cryptocurrency market. The Designer program, for example, offers a trading solution by building its profitable strategy.

Anyone, even a novice trader, can build his robot with the help of cubes responsible for the trading algorithm. Built-in capabilities for debugging strategies on different markets, with the ability to trade on several platforms at once, make it an indispensable tool. More information about all the products of our company can be found on our website. https://stocksharp.com/articles/10679/Designer---create-a-strategy-based-on-MACD-Start-with-simple/ Designer - create a strategy based on MACD. Start with simple. 2019-05-06T18:15:06+03:00 2019-11-18T07:05:29+03:00 Marat https://stocksharp.com/users/101940/ firstname.lastname@example.com Creating a strategy in the Designer program.

Let's discuss an example of creating a trading strategy in a program based on the MACD indicator values.
The indicator's goal is as follows:

1. If the MACD indicator histogram crosses the zero line from top to bottom, this is a sell signal.
2. The transition of the histogram from the negative to the positive zone is a buy signal.

Therefore, it is necessary to create conditions under which a trade will be made, namely, if the indicator value on the next candle changes its sign, then the signal is sent to make a trade.
To create a strategy, we need:

- Run the program.

- Select the Variable, Candles and Chart Panel blocks, connect them.

- Select an instrument with which we will test the strategy.

- Plot a candle chart.

- Select the Indicator and Chart Panel blocks. Connect the Indicator and Candles blocks.

- Plot a chart of the MACD indicator.

- Select the Variable block and assign it a numeric value of 0 for further comparison with the indicator value.

- Select the Comparison block and set the test condition in the properties: execution during the test, with the MACD indicator value greater than 0.

- Add two Variable blocks and Comparison block. One of the variables is set to -1 in the block properties. It will indicate the transition of the MACD curve value from negative to positive area. The second Variable value is set to 0 in the properties, that will indicate the initial indicator value.

- Set the condition in the Comparison block that will be fulfilled if the initial indicator value for the time frame is greater than the current one.

- Connect the Variable blocks via a trigger socket with the Comparison blocks, as shown in the figure.
Select the Logical Condition and Variable cubes.

- The execution condition of two comparisons will be checked in the Logical Condition cube. Set the AND condition in the properties of the Logical Condition cube and connect the cubes as shown in the figure.

- Set the value equal to -1 in the Variable cube and connect it with the Logical Condition cube via a trigger socket, and through the output connect to the input of the cube with a value of 0. This will allow overwriting the checkbox value when conditions are met, indicating within what range of values the MACD indicator curve is.

- Select the Open Position block, select the Buy direction in the settings and connect data and trigger with the socket, as shown in the figure.

- Select two Variable blocks in which to set the volume and portfolio for trading. Connect them with the corresponding sockets of the Open Position block.

- Similarly, create a routine for the Sales execution.

-The strategy is ready, let's run it.

 https://stocksharp.com/articles/11166/FAQ-on-FIX-Protocol-Limit-orders-FOK-and-IOC-(FAK)/ FAQ on FIX Protocol. Limit orders FOK and IOC (FAK). 2019-11-15T18:04:12+03:00 2019-11-15T18:04:32+03:00 Marat https://stocksharp.com/users/101940/ email@example.com Earlier, we said that the FIX Protocol not only increased the speed of traders in the market, but also provided an opportunity for market participants to use limit orders, which reduced the risks of trading. Let's take a closer look at two types of limit orders.
Let's start with the FOK order.
Literally, its name stands for - 'Fill Or Kill'. The essence of this order is that it is executed immediately and in full at the stated price, or will not be executed at all, which eliminates the possibility of slippage. Thus, if your order cannot be executed in full, then the order is simply rejected, if the order can be executed in full, then the order is executed in full at the specified price.  This type of order is very convenient for scalping or arbitrage strategies, as they eliminate the risk of slippage. In fact, we can say that the "Edward – Scissorhands" arbitrage strategy from StockSharp eliminates risks. Below is an example of the rejection of the FOK order in the CME system, due to the fact that the order size is 20, and the book contains only 19, so the order can not be executed completely, and the system cancels it.

The next type of limit orders are IOC orders.
The name 'Immediate OR Cancel' means that the order is executed in whole or in part at the set price, otherwise the order will be canceled. For example, if the order size is 100 units, only 50 units can be sold at the set price. If we use an order of type FOK, the system will cancel it, as it can not be fully executed. When using the IOC limit order, the order will be executed for 50 units, and the remaining ones will be canceled. IOC also has another name FAK, which stands for 'Fill And Kill', executed and discarded the remainder.
For example, an IOC order will be partially executed (in the CME system, its name is FAK). If we buy 15, and the book contains only 10, then we buy 10, and the remaining 5 are rejected, so this order can be called partially executable:

Limit orders when working through the FIX Protocol allow the trader to reduce risks, and in some cases, especially when working with arbitrage strategies to reduce them to zero. Our company provides a range of programs to work in the market through FIX connect, such as: designer trading strategies Designer, trading program Terminal. We also provide a full range of connectors for connection to trades, including FIX. Flexible system of discounts and reliability of connection, makes us one of leaders in the market. The full range of connectors and software can be found on our website.
 https://stocksharp.com/articles/6986/SData-(Hydra)---manual-and-examples-of-use/ S#.Data (Hydra) - manual and examples of use 2016-12-01T23:17:40+03:00 2019-05-01T01:28:53+03:00 Mikhail Sukhov https://stocksharp.com/users/201/ firstname.lastname@example.com
Intro

Hydra is a program for downloading and storage of market data. This article will explain how to download the history from Google Finance, Gain Capital broker and IQFeed service.

To begin we tell a little bit about the program interface. After the first start you will see the main window, which prompts you to select the data sources.

Pay attention to the description of each source, if the following is written next to it:

Source is designed to get history data … - then it means the ability to download historical data,

and if the following is written:

Source is designed to get market-data .. - then it means the ability to connect to the real-time data source and one's own history collection. Looking ahead, a similar process is often cheaper than a simple data purchase from a data vendor.

Now select the number of sources and try to get the market data. As such, we propose to use: Google (as a source of historical data), OECTrader (as a source of real-time data, which the broker gives you when opening an account), IQFeed (as a source of real-time data with the maximum number of concurrent subscriptions).

Click the check-boxes in the selected sources.

After you click OK, the program prompts you to enable additional features.

They are well documented in the program itself, so we will not go into a description of each of them.

In order to move forward it will be enough just to click OK without selecting anything in this window. If necessary, you can always restore this setting via the ADD -> Tools button and select the required.

After all the previous procedure, we have got added sources in the left pane, all of which must now be set up.

Google Finance

This is done simply by pressing the pen button,

that opens the settings window.

Quickly go over each of them to get a full understanding. So:

Start date – the date from which Hydra will receive market data

Time Offset – In this case, 1 means that the today data will not be downloaded. This is necessary in order not to download half a day, when the trading have not yet been completed.

Weekend – weekends ignored when checkbox is selected.

Time interval – Hydra downloads data in parts. This parameter allows to specify how large data part will be used. With a value of 30, the program will download data packages for 30 days.

Header, work from, work until, work interval – settings for the program itself, the time interval during which the program should download data (from and to)

Data directory – a directory in which the downloaded data will be stored, you can leave the default, or choose any other. We recommend to create a separate directory for each source, in order to not overwrite the data.

Format - the format of the stored data. BIN supported – Hydra's special format allows to get a unique compression ratio (2 bytes per tick, 7 bytes per order book) or well-known CSV (it is normal volume)

Max.errors - the maximum number of errors in the source.

Dependency - specifies the added task that must be completed before the current (in this case, it may be either IQFeed, or OEC Trader)

Logging level - the level of logging.

Let's leave all the default data and choose the securities on which the data will be downloaded. Let's say we choose 5 tickers included in the S&P500 index, for example: MMM, AFL, GOOG, AAPl, T.

For this purpose, all these tools you need to add:

Since Google source does not support the automatic addition of the tools you should to add them to the database manually

Then repeat the procedure for each security and move them to the Selected section

Then simply connect the source  and press Start.

After the end of the downloading you have to get the following results

OpenECry (Gain Futures)

The market data source for the Gain Capital clients, which a broker gives you for free when opening an account. The source key settings in many ways similar to the settings that we have made in Google with the only difference that now you should enter your account username/password to access the data stream and select the correct address from which the data will come. Preset 3 possibilities: the test server (to which we connect and which is intended for developers), the simulator (server for demo accounts), the real server (the server that has the connection to the real market and real accounts). If you have an opened account, then your choice is the real server.

The CandleFromDate parameter is needed to specify the starting date from which you want to download the history in the form of candles.

Once it has been done, we add instruments by which we want to get data, because OEC supports automatic downloading and searching of instruments. We do it through the Download Securities button, and then adding them through the instrument code. Our selection ESZ6 (mini S&P) and NQZ6 (mini Nasdaq).

After adding you should get the same as shown in the picture.

Now turn your attention to the bottom part of the window. At the beginning of this article, we talked about the fact that Hydra supports downloading and storing a plurality of market data types, settings about what data to download can be done using the appropriate panel:

On Ticks - means that ticks will be downloaded
On Market Depth - means that order books will be downloaded
Candles has additional setting, by clicking the button you can select the candles types which will be downloaded, that's how it looks:

On Level 1 - means that the best bid/ask will be downloaded, as well as some fields of the ticker basic statistics.

Now just click the Start button, and Hydra will start to receive data and store them locally. In this case, both historical and real-time market data will be received.

Thus, you can collect and store the market data yourself, and then use them for testing your own strategies.

IQFeed

IQFeed provides as OpenECry, intraday data. But, in contrast to the OEC, IQFeed supports a very wide range of parallel subscriptions, as well as a much greater depth of history, both for candles and tick data.

The source settings similar to OpenEcry:

The CandleFromDate parameter is needed to specify the starting date from which you want to download the history in the form of candles.

The TicksFromDate parameter is needed to specify the starting date from which you want to download the history in the form of ticks.

All other steps are similar to those described above.

Data viewing

Now, after all the manipulations, you need to understand, and how to work with these data, and what the program can do else. Recall that data is stored in the directory where you downloaded them, but how to see what is a result.

For this we refer to the OEC Trader source from which a lot of data has been downloaded, select it and click the right mouse button.

Thereafter, we can choose in the menu the way to work with the instrument. Let's choose Market Depths and then in the window that opens, click the magnifying glass.
As a result, we will get a similar picture

Next, similarly we select Level 1, and then Candles 1 min, but in the window with candles we do not choose the magnifying glass, and Chart button. The results are shown in the figures below

That's the way you can view the data and work with them directly from the program.

We hope our product will help you in trading and development of profitable trading systems.
 https://stocksharp.com/articles/6987/Downloading-the-US-market-data-via-Hydra/ Downloading the US market data via Hydra 2016-12-01T23:45:37+03:00 2019-05-01T01:27:03+03:00 Mikhail Sukhov https://stocksharp.com/users/201/ firstname.lastname@example.com In our today's article, we will talk about where to go for free or for a relatively small amount of money to download historical data on the US market, as well as about a universal way to download, store, analyze and use in your own algorithms all types of market data.

First, let's concern the main sources of market data on US securities with a brief description of them. In general, there are three types of sources:

1. Sources of historical data, such as exchanges, which provide trading history on their own sites (of course, we do not consider direct connections, which are of type 2).
2. Sources of market data, such as broker terminals, through which it is possible to download also some history, but the main interest is what is happening right now.
3. Multifunctional sources that combine the type 1 and type 2, and usually presented by specialized services.

The first type of sources includes sites such as Google and Yahoo Finance:

The apparent advantage of these services is their full free, but on the other hand, it is impossible to download intraday market data, as well as impossible to get anything other than candles. By this we mean the data such as Level1, Order Log, Market Depth, etc.
This practically eliminates the possibility of using the data for testing strategies involving the intraday trading. On the other hand, if your strategy assumes a medium-term trade, for example, based on the Turtle approach, or you practice portfolio investments without too frequent portfolio shake-up, then use of data from these sources to be very reasonable and appropriate.

The sources of market data as already described above, are, primarily, broker terminals or other connections to the broker, which every practitioner trader has. For example: Fusion/Blackwood, Rithmic, Gain Capital, OEC Trader, Sterling, etc.

Benefits from the use of this source can be seen almost immediately. First, it is free (of course excluding those fees that you pay to the broker). Second, it is large amount of data that can be obtained: some types of candles, ticks, Level1, DOM etc. On the downside, there are the lack of deep history and the need to collect the necessary data using cunning way, when it is nothing to do without specialized software.
With this approach your capabilities for testing are greatly enhanced. There is a possibility to create not only intraday strategies, but also high-frequency algorithms based on historical regularities found.

Multifunctional sources are mostly specialized services that provide a real-time market data as well as any requested history, for example IQFeed.

The main advantage of this source is its versatility and fullness of the data, i.e. at any time it is possible to get any desired data by the user's request such as ticks, candles, order books etc. The downside of this approach is the payment for this service, the price of which starts from $50 per month for the basic version. If there is a desire to get a few more, it is necessary to connect the additional functions which, as you already understood, will cost money too. But like the previous option, you will need a special program to collect and store the data. Since, at the end of your subscription, you will lose all data. Plus, though the depth of history is more than at the previous method, but it is still limited. Especially for tick data.

Now we can proceed to the most interesting, but how do we get the history optimally and do not spend a lot of money. In our opinion, the common approach is as follows:
- to download the daily candles from a free source, and to test your strategy preliminary on these data;
- to download intraday data through your broker, and to test the strategy in more detail;
- the purchase of a subscription to a paid service, and downloading the data array of interest.

In order to realize suchlike a specialized software will be necessary to download the required data from the required service for you first, and then it will continue to collect the data from your broker in a common format. Thus, the unity of data will not be lost and this data can be easily used for further analysis.

For such tasks we have created the S#.Data (Hydra) program (to read the instruction manual and have a look at examples of use here). This is a free program available for download. Hydra provides a variety of functions, but its main task is to download and store the data.

Hydra supports downloading not only candles of any timeframe, but also ticks, order log, level 1, order books on a variety of instruments. The program can not only download but also store the data incoming from the broker, for example from OEC Trader, Sterling, etc.

Hydra stores data in the CSV or BIN formats (super compact storage format – 7 bytes per 1 order book image or 2 bytes per tick). The data are located locally, like files, and they can be accessed from any programming language, that eventually allows the user to store and use a vast array of market data on a home computer, a server or in the cloud (AWS supported).

Summing up the article, we hope that the techniques outlined in it will allow you to get the market data for adequate means and become a bit closer to the professional participants.
They have long been doing just that.

Good luck on the market! https://stocksharp.com/articles/10642/How-to-download-market-data-to-the-Designer/ How to download market data to the Designer? 2019-04-25T12:35:50+03:00 2019-04-26T00:39:18+03:00 Marat https://stocksharp.com/users/101940/ email@example.com

In order to download market data to the Designer program for testing a trading strategy, you need to do the following:

1.Run the program.

2. Select the Market Data section in the top menu and click on it.

3. In the window that appears, select the Download Securities button in the Securities panel, in the menu that appears, tick the All option and select the storage. Then click the OK button .

4. In the list of downloaded securities, select the one we need.

5. Choose a period for which we need market data, and candles that we need.

6. Select the path to storage where our market data will be stored, for this, we click the "+" button.

7. In the menu that appears, select the full path to store the downloaded market data.

8. Click the Start button
9. In the window that appears, select the market data source.

10. In the window that appears, click the "+" button and select the source we need from the drop-down list.

11. Click the OK button.

Market data downloaded to your storage. Enjoy using. https://stocksharp.com/articles/10641/Designer-Knowledge-Base/ Designer Knowledge Base 2019-04-25T12:28:29+03:00 2019-04-25T18:46:03+03:00 Marat https://stocksharp.com/users/101940/ email@example.com Frequently asked questions about Designer:
1. How to download market data to the program?
2. How and where to specify an instrument for strategy backtesting?
3. How to create a condition in the strategy?
4. Compound indicators, methods of their decomposition. https://stocksharp.com/articles/9217/New-crypto-algorithms/ New crypto algorithms 2018-03-12T14:07:14+03:00 2018-12-30T15:51:56+03:00 Yury Basangov https://stocksharp.com/users/7/ email@example.com Hello, dear friend!

As you already know, we launched the second stage of crowdfunding for the crypto connectors on March 1st. This time, we did everything in a new way, including with regard to algorithms.

We will now provide algorithms without black boxes. All participants will be given strategies with source codes. To be the best in the market, unique settings are required for algorithms. Sometimes this is not possible without changing the code. We will be fully open to the supplied automation.

In this article, we describe the algorithms set up especially for you. This is our technical assignment. We specifically provide complete information BEFORE you choose to participate.

Synthetic arbitrage

This idea is similar to our main crypto robot, Edward. Synthetic arbitrage is built on a long combination of BTC/ETH/LTC//ETH/BTC. Connectors to exchanges, where there are similar coins, are set for the strategy, and then it independently chooses the convergence-divergence on the found pairs to track the arbitrage situation.

Edward-Crypto News
For those who use Edward-Crypto (напиши нам по указанным ниже контактам, если хочешь получить и эту стратегию). За счет значительно продвинутой модели торговли у существующего Эдварда, для него синтетический арбитраж будет возможен с опцией автопоиска нужных пар. Н(write to us at the contacts specified below if you want to get this strategy). Due to the significantly advanced trade model of the existing Edward, synthetic arbitrage will be possible for it with the option of auto-searching for the necessary pairs. For example, BTC/*/LTC/*/LTC/ETH/BTС. The program will automatically select an effective coin as pairs to search for arbitrage divergence. This option will be available only to users of Edward-Crypto!

Pump detector

This is a special automation, tracking the growth of cheap coins with cosmic returns in a few hours. The robot can either monitor and generate a signal or actively enter the position and exit it after a certain movement to take profit. The robot will track all coins on all available connections. Of course, we are talking about very cheap alts, where you can increase your deposits 10 times a day. The main advantage of the algorithm is to get out in time, but the robot, of course, will be faster than our hands.

Carrier

It's very simple - the transfer of money from one exchange to another by the robot. Auto selection of the cheapest coin for transferring, for example, BTC positions through intermediate conversion to cheaper cryptocurrency, i.e. Vertcoin, Ripple, etc.

Modularity
The key point behind all of the strategies being developed is modularity! All of our strategies are run in unlimited quantities within the same program. Edward-Crypto will also act with new strategies, all in one bundle. The Converter will work, for example, in a pair with arbitrage strategies, watching for an increase in positions on certain exchanges.

We hope that this ambitious change in the second round will be even more interesting for you!

Have any questions? E-mail us at firstname.lastname@example.com and we will be happy to answer any of your questions.
Do not put off the decision, just now one algorithm can be obtained for only 1000$, then the minimum investment will be doubled!!!

Are you ready?

 https://stocksharp.com/articles/10131/SUI---StockSharp-Graphic-Framework/ S#.UI - StockSharp Graphic Framework 2018-11-15T16:25:45+03:00 2018-11-26T22:13:12+03:00 Yury Basangov https://stocksharp.com/users/7/ email@example.com

In this paper, I will show how to use graphic components included in S#.API, in order to create a fully-featured application of the S#.Shell:

You will learn how to make a professional-level program with connection settings, output of securities, prices, and charts (and all this is saved and loaded upon restart). And the complexity of creating such an application is not a few months, but just a few hours (it is no joke! read to the end). This is the main advantage of the graphic framework, which I called by analogy S#.UI (this name is unofficial, I think it up myself).
I will not use complex constructs and design patterns that are understandable only to professional programmers. On the contrary, the paper's purpose is to show that the learning curve on creating your trading applications using S#.API is very short.
You will also be interested if you work in a company and make your own unique software (for example, you work in proprietary trading or a brokerage company). In this paper, you will be able to learn the practice of creating such systems (especially if you have just taken up your duties).

What You Need

1) Visual Studio 2017 (Community, free version), in which we will program.
2) Free connection to test exchange trading, I will use QUIK.

Creating Project

We create a new WPF application in Visual Studio.

After that we need to add the S#.API libraries, and how to do this is described here. I prefer installing with Nuget.
Since all S#.API graphic elements are based on DevExpress, and DevExpress libraries are included in S#.API, it would be foolish not to use them. All information about DevExpress graphic elements can be found in Google.
Let's go to the MainWindow.xaml window editor.

We replace Window with DXWindow, we will need it to use different color schemes.

Visual Studio will prompt us to add the necessary libraries.
We split the window into three parts, there will be a bar with buttons of connection setting and connection at the top. The window with logs will be below. All other panels are in the middle. The easiest way is to split the window in this way using LayoutControl from DevExpress.
We will add the elements we need to the resulting three parts.

Configuring Connection to Connector

We add two buttons, one button to configure connection and the second button to connect. To do this, we use the SimpleButton button from DevExpress. The buttons will be located at the top of application. We will place pictures familiar with Terminal and Designer on each button.

We will see such an image in the upper right corner of the screen form.

We double-click each button to create button click event handlers.
In MainWindow code it is necessary to declare the connector, as well as the file location and name where the connector settings will be stored.

We will open the connector configuration window in the connector settings button click event handler and save it to a file.

We will check in the constructor whether there is a directory and a file with the connector settings and, if there is one, we will load it into the connector.

Most S#.API objects have Save and Load methods, with which it is possible to save and load this object from an XML file.
We connect the connector in the connection button click event handler method.

Now we can run the program and test it.

Setting Dark Theme

I prefer a dark theme. Therefore, we make the program theme dark at once. To do this in the App.xaml file

We replace Application with charting:ExtendedBaseApplication. Visual Studio will prompt us to add the necessary libraries. And in the file App.xaml.cs delete ": Application". The code will be the following.

We write ApplicationThemeHelper.ApplicationThemeName = Theme.VS2017DarkName in the MainWindow constructor;
Full code at the moment:

Run to check the dark theme.

Creating Security Panel

We add the XAML folder where we will store all the created controls.
We add our first UserControll to the folder, let's call it SecurityGridControl.

We add one SecurityPicker element to it. In which the available securities will be displayed. Similar to the main window, we will use LayoutControl from DevExpress.

We go to the main window constructor and change the central part to the tab view. We place created control with SecurityPicker in one of the tabs.

Now we have the security panel, we need to set it a data source, in our case it is a connector. It was possible to write SecurityPanel.SecPicker.SecurityProvider = Connector in MainWindow constructor.
But we will not place code in the MainWindow that is not related to it. Therefore, I will create the Instance static variable, and assign it the MainWindow value in the MainWindow constructor.

Now we can call the MainWindow properties anywhere in our program using MainWindow.Instance.XXX code.
In the SecurityGridControl constructor, we specify Connector as a data source.

We run the program to check.

Adding Logging

The operation of the program, connector or robot must be monitored. For this purpose, S#.API has a special LogManager class. This class receives messages from sources and sends them to listeners. In our case, the sources will be Connector, strategies, etc., and listeners will be a file and log panel.
In the MainWindow code, we declare the LogManager object and the location where it will be stored.

In the MainWindow constructor, we create LogManager, set in it Connector as the source, and a file as the listener.

Similar to the security panel, we create a log panel, add another UserControl to the XAML folder. We call it MonitorControl. We add the Monitor element to it.

In the MonitorControl constructor, we set Monitor as a listener in LogManager.

We add the created MonitorControl to the bottom of MainWindow.

We run the program to check.

Creating Portfolio Panel

Similar to the security panel, we create a log panel, add another UserControl to the XAML folder. We call it PortfolioGridControl. We add the PortfolioGrid element to it.

In PortfolioGridControl constructor, we need to subscribe to new portfolio appearance events and event of new position appearance at Connector.

Thus, when a new portfolio appears, it will be displayed in the portfolio panel, and when a new position appears in the portfolio panel, the portfolio will update the position.
We add the created PortfolioGridControl panel to the central part of MainWindow.

We run the program to check.

We have a tab with portfolios.

Creating Order Panel

The order panel in S#.API has the ability to register orders, cancel orders and reregister them.
Similar to the security panel, we create an order panel, add another UserControl to the XAML folder. We call it OrderGridControl. We add the OrderGrid element to it.

OrderGrid has the OrderRegistering event, the OrderReRegistering event, and the OrderCanceling event.
Let's create their handlers.

In the order registration event handler, we create an OrderWindow window where we need to specify data sources for securities, portfolios, and market data. For all cases, this will be the Connector.
After that, we call OrderWindow using ShowModal method, if the OK button was clicked in this window, we register the order via the connector using the RegisterOrder method.

We do the same in the order reregistration event handler. Only in this case the event receives the Order object - this is the order that needs to be reregistered. Therefore, in OrderWindow, we specify Order = order.ReRegisterClone(newVolume: order.Balance) to fill in the fields of the OrderWindow window.
After that, we call OrderWindow using ShowModal method, if the OK button was clicked in this window, we will reregister the order via connector using the ReRegisterClone method. We pass to it old order, which should be cancelled, and the new one, which should be registered.

In the order canceling event handler, it is enough to call the CancelOrder method and pass to it the order that need to be canceled.

In order for Orders to be displayed in the OrderGrid, it is necessary in the OrderGridControl constructor to subscribe to new order appearance events and to a registration error event and pass these events to the OrderGrid.

We add the created OrderGridControl panel to the central part of MainWindow.

We run the program to check.

Creating Panel of Own Trades

Similar to the security panel, we create a panel of own trades, add another UserControl to the XAML folder. We call it MyTradeGridControl. We add the MyTradeGrid element to it.

In the MyTradeGridControl constructor, we need to subscribe to the new own trade appearance events and pass it to MyTradeGrid.

We add the created OrderGridControl panel to the central part of MainWindow.

We run the program to check.

Creating Order Book Panel

Similar to the previous panels, we create an order book panel, add another UserControl to the XAML folder. We call it MarketDepthControl.
In MainWindow we have already used LayoutControl, in this control we will also use LayoutControl. We split the panel into two parts horizontally.

We add SecurityPicker to the left side, we use it when we created the security panel.

Let's split the right part into vertical parts. There will be an order book on the top right.

In MarketDepthControl, we need to set some MaxHeight value, otherwise the application will not start.
Below the order book we will place the elements of specifying a portfolio, price, and order volume.

Here it is worth noting the Label property of LayoutItem, it allows to set the text over the element. And also the SpinEdit element from DevExpress, in which it is convenient to set numerical values. These elements look like this.

Even below, we will place the buttons to buy, sell.

Full code.

In the MarketDepthControl constructor, we set the security source for SecurityPicker and the portfolio source for PortfolioComboBox, in our case it will be Connector.

We create a security selection event handler in SecurityPicker. We check in it whether the selected security is not equal to zero. If it is not equal to zero, we save the received security to a local variable, we will need it when updating the order book. After that, we clear and register the received security in Connector to receive an order book using the RegisterMarketDepth method. Using the GetMarketDepth method, we get the current order book on security to update the MarketDepthControl.

To keep the order book updated in the MarketDepthControl constructor, we will subscribe to the MarketDepthChanged order book change event at the connector. In the handler of this event, we will check which security the received order book belongs to, and if it belongs to the security selected in SecurityPicker, we update MarketDepthControl with it.

We add the created MarketDepthControl panel to the central part of MainWindow.

At this stage, we can run the program and check the order book update operation.
We create a buy and sell buttons click event handler. In each handler we create an Order, in which we specify the security selected in SecurityPicker, the portfolio selected in PortfolioComboBox, the volume and price from the corresponding SpinEdit. We register the order in Connector using the RegisterOrder method.

Both handlers differ only by the order direction.
Let's make that the SpinEditPrice value is changed to the selected quote price when selecting a quote in the order book. To do this, we will create a handler for the SelectionChanged event at MarketDepthControl. In which we will update SpinEditPrice value by the price of the selected quote if the selected quote is not equal to zero

We run the program to check.

Saving Market Data

To save portfolios, securities, platforms, we need the CsvEntityRegistry class. We need to pass the entities storage location to it and call the Init method to load them.

To save candles, trades, etc., we will need StorageRegistry.

We will also need the SnapshotRegistry snapshot storages registry.

All this we pass to Connector when it is created.

Here I also specified that Connector will reconnect when the connection is broken, and also specified how many history days should be downloaded.
The Connector.LookupAll(); string queries the available data.

After starting the application, we will see that new folders have appeared in the Date folder.

And when reconnecting the security and portfolio panels will already be filled.

Creating Strategy Panel

I will create the strategy panel just like all previous panels.
We add another UserControl to the XAML folder. We call it StrategyControl. We split the screen form into two parts using the LayoutControl.
There will be a tab with a candle chart on the left side.

As well as a tab with strategy statistics,

Here I use StatisticParameterGrid to display strategy statistics and EquityCurveChart to display profit and loss chart.
In StatisticParameterGrid, we need to set some MaxHeight value, otherwise the application will not start.
The strategy properties in PropertyGridEx will be configured on the right side.

As well as strategy start and stop buttons.

Full code.

In the StrategyControl constructor, we set Connector as a data source for PropertyGridEx, we carried out similar actions in almost every control.

We need to somehow pass the strategy to our control. To do this, in StrategyControl I will create a BindStraregy method that will receive a strategy, save a link to it in the local variable, and also set a strategy in PropertyGridEx and StatisticParameterGrid.
Using the SetChart method, we pass the Chart candle chart to the strategy, after that, the Chart can be obtained in the strategy using the GetChart method. We also set the Connector for the strategy.

When working with the profit and loss chart, it is necessary to take into account that the strategy may start and stop several times, so every time the strategy starts, the chart should be cleared. To do this, let's create the ResetEquityCurveChart method, in which we will first clear EquityCurveChart. After that we need to create graphic elements for EquityCurveChart, for them we can set a name, color and line type.

Then, we subscribe to the PnL change event of the strategy and in this event handler we draw a new value on the EquityCurveChart profit loss chart.

Full method code.

We will call this method in the Start button click event handler. And also we will reset the strategy state and run it.

We will stop the strategy in the Stop button click event handler.

We add the created StrategyControl panel to the central part of MainWindow.

Creating Strategy

For example, let's consider creating a simple strategy with candles. Which will buy if the candle is growing (green), and sell if the candle is falling (red).
Let's create another folder in the project and store all our strategies in it. We create a new class in this folder and call it SimpleStrategy. All S# strategies must be inherited from the base class Strategy.

Since our strategy uses candles, we will create a public property CandleSeries, and set its default value in our strategy constructor.

Here I specified that candles in CandleSeries will be TimeFrameCandle with time span of 15 seconds (TimeSpan.FromSeconds(15)). We can specify the candle creating mode for CandleSeries - BuildCandlesMode. I specified that candles will be built (MarketDataBuildModes.Build), by default they will be built from ticks, but we can specify other data types as well.
Since we made the CandleSeries a public property, the CandleSeries can be additionally configured from the PropertyGridEx described in the previous paragraph.
All strategies have methods that can be overridden, we will need to override the OnStarted method. Which is called before the launch of the strategy and allows to preset its starting state.

Here we set the security for CandleSeries, which is specified in the PropertyGridEx. After that, we create a rule for processing the completed candle. See the documentation for details on working with rules. In the rule we specify the method that will process each completed candle, in our case it is the ProcessCandle method, it will be described later. After everything is set, we subscribe to the appearance of candles on the CandleSeries in connector using the SubscribeCandles method.
In our case, the ProcessCandle method contains the main strategy logic.

First of all, we need to determine whether the candle is real-time or historical, if the candle is historical, we ignore it. Not all strategies require this, for example, for strategies based on order books, this is not required, since order books are always real-time. There is no general way to determine whether a candle is real-time or historical, and in each strategy this problem will have to be solved independently depending on the strategy requirements. In this case, I will simply compare the candle closing time with the connector time, and if it does not exceed a certain lag, then I consider the candle real-time.

Next, we consider what candle it is and what the strategy current position. If the candle is growing, then at a position equal to 0, we will open a position with a market order for the volume set by us in PropertyGridEx. If the candle is growing and the position is less than 0, we reverse the position.

We do opposite actions for a falling candle.

At the moment, our strategy is ready to work. It should be passed to SimpleStrategyControl, which we created in the previous paragraph using the BindStraregy method. We do this in the MainWindow constructor immediately after the MainWindow components are initialized.

We run the program to check.

The strategy works, trades are made, but there are no candles and trades on the chart yet.

Adding Candles and Trades to Chart from Strategy

In the paragraph about the strategy panel, we passed the Chart candle chart to the strategy using the SetChart method. In the OnStarted strategy method, we check whether the strategy has a chart set, and if it is set, then we initialize the chart, as well as subscribe to the events of new own trade appearance and candle change.

InitChart chart initialization method.

Here we save the link to Chart in a local variable. We clear the chart. We also create chart elements for candles and trades and pass them to the chart.
The chart.GuiSync(()=>{ ... }); construct is necessary in order to initialize the chart in the main thread.
CandleSeriesProcessing is a method for drawing candles on a chart.

Here we get a candle from the CandleSeriesProcessing event of the connector, create ChartDrawData to display it on the chart. We specify the time data.Group(candle.OpenTime), specify that the candle should be added to the candle element of the chart .Add(_chartCandleElement, candle);. And we specify that the chart should draw new data.
We perform similar actions for trades.

We run the program to check.

Short conclusion

It is not necessary to spend a lot of time to create a complex and professional-looking application. In a few hours we created the fully-featured application with the ability to configure, display and trade directly.
Do not be afraid to try and create your own programs. I hope this paper will help you get used to this business.

 https://stocksharp.com/articles/8802/BTC-vs-BTC-Arbitrage!/ BTC vs BTC. Arbitrage! 2017-11-08T02:39:55+03:00 2017-11-14T18:08:51+03:00 Mikhail Sukhov https://stocksharp.com/users/201/ email@example.com Recently, interest in crypto currencies has grown in leaps and bounds. New exchanges have opened, hard forks, ICO, new crypto-currencies are being created and this whole movement generates a huge sea of opportunities.

One of these opportunities will be discussed in this short article.

Not so long ago, we launched the crowdfunding project to create new connectors to 10 crypto-exchanges (Bitfinex, Coinbase, Kraken, Poloniex, GDAX, Bittrex, Bithumb, HitBTC, OKCoin, Coincheck), while the two connectors to Wex.nz and Bitstamp are already implemented in our platform. This project would not be needed if the currencies were traded more centrally, but the number of exchanges already exceeded a few dozen. More connectors, more stable trading, and more entry points for arbitrage bitcoins and other popular crypto currency.

The target function of any exchange is to match buyers with sellers, but the price of an asset at which bidders are trying to make a deal can be different! Since the digital assets economy is just beginning, this difference can be very significant.

This fact gives rise to the possibility of so-called arbitrage - to buy assets when they are cheaper and sell when they are more expensive.

Let's see an example. The screenshots below of exchanges are further made at the same time.

GDAX BTC order book:

BTC quoting by $7 313,88 price.

For the same BTC on Wex.nz

Same BTC but price already $7 373
Another exchange - Poloniex:

BTC has a price of $7 323

No comments ;-)

Join our shared campaign of creating new connectors and we will provide you with technical tools for arbitrage between exchanges (and, consequently, earnings on this strategy). Particularly important, we will provide an automated trading robot, which has already been performing arbitrage trading with Bitcoin for almost a year.