Writing a trading bot. How to write a trading robot - straight to the point


One of the most common questions asked by people just starting to get interested in algorithmic trading is “What programming language is best for this?” Of course, the short answer is that there is no “best” option. When choosing a tool, you should take into account the parameters of your trading strategy, the required performance, modularity, development methodology and fault tolerance requirements. In this article, we will talk about the main components of the architecture of an algorithmic trading system and how each of them influences the choice of programming language.

Translator's note: We very often encounter skepticism towards algorithmic trading. There is an opinion that this is pure speculation, which is extremely harmful, and doing this for a technical specialist, to put it mildly, is not comme il faut. Anticipating some questions in the comments, we would like to immediately provide a link to the material, in which a lot of attention is paid to the description of what types of traders exist in the stock markets and why EACH of them brings a certain benefit at a certain point in time, as well as to a topic in which more affected common topic the purpose of the exchanges themselves. But here you can read about the experience of such trading, which allowed a person with knowledge of programming to earn half a million dollars (first part, second part.) Enjoy reading!

First of all, we will look at the main elements of an algorithmic trading system, such as analytical tools, a portfolio optimizer, a risk manager and, in fact, the trading engine. Then we will touch on the features of various trading strategies and how the choice of any of them affects the development of the entire system. In particular, we will discuss the expected frequency (speed) and volume of trading.

After you have chosen a trading strategy, you need to design the architecture of the entire system. This includes the choice of hardware, operating system (or several systems) and resistance to rare but potentially catastrophic turns of events. When designing the architecture, you should also pay due attention to performance - both the speed of the system's analytical tools and the trading engine itself.

What does the trading system do?

Before choosing the “best” programming language in which our robot will work, earning millions, we need to determine the requirements for this language. Will the system be purely task-based or will we also need a risk management or portfolio builder module? Will you need a fast back-testing module to work? For most strategies, trading systems can be divided into two categories: research and signal generating.

Research strategies focus on testing performance against historical data. Testing on data collected in the past is called backtesting. The computing power of the backtesting module is affected by the volume of data and the algorithmic complexity of the strategy. When optimizing the speed of research strategies, the limiting factors are often the speed of the processor and the number of its cores.

If we talk about generating trading signals, then the algorithm must understand when to buy or sell and send the corresponding orders (most often through a brokerage system) to the market. Some strategies require a high level of performance. The speed of the strategy is limited by factors such as the width of the data channel and the delay introduced by the brokerage and exchange systems (latency).

Thus, depending on what category of strategy you need, and the choice of programming language to implement it may vary.

Type, liquidity and volume of strategy

The type of trading strategy will affect its entire subsequent structure. It is necessary to evaluate in which markets it is planned to trade, the possibility of connecting external data providers, as well as the frequency of transactions performed by the algorithm and their volume. Important factors will be finding a balance between ease of development and performance optimization, as well as hardware, including servers that will need to be placed in brokerage or exchange data centers, and additional equipment that may be needed (GPU, FPGA, etc.).

Trading low-liquidity stocks in the US markets will require very different technology than a high-frequency statistical arbitrage strategy in the futures market. Before you start choosing the actual programming language, you should start selecting data providers with which your trading strategy will work.

It is necessary to analyze the existing connectivity to supplier systems, the structure of any APIs, the speed of data delivery, and the ability to store it in case of failures. A wise decision would be to organize access to several such systems at the same time, which will also require separate development, since each data provider has its own technological requirements (ticker symbols of exchange instruments, etc.).

The expected trading frequency will have a determining impact on how your system's technology stack is implemented. Strategies that require data updates more than once per minute will require large resources to operate.

In the case of strategies that require tick data, it is necessary to develop the entire system according to the performance driven design methodology. HDF5 or kdb+ are often used for these tasks.

To handle the excessive amounts of data required by HFT applications, it is necessary to use both an optimized backtester and a trading engine. The main candidates for the role of a programming language in such a system would be C/C++ (possibly Assembler in some places). High-frequency strategies will often require additional equipment, such as field programmable matrices (FPGA), as well as placing servers as close as possible to the exchange core and tuning the network interfaces of the servers themselves.

Research systems

When creating systems of this nature, it is often necessary to resort to interactive development and script automation. The first concept takes place in an IDE like Visual Studio, MatLab or R Studio. Script automation involves a lot of calculations for different parameters and data points. Taking all this into account, it is necessary to choose a language that provides excellent opportunities for testing code, and also allows you to achieve acceptable performance when calculating strategies for different parameters.

At this stage, IDEs such as Microsoft Visual C++/C# are often used, which includes a variety of tools for debugging, code completion and working with the entire project stack (ORM, LINQ); MatLab, which is designed specifically for problems of numerical linear algebra and vector operations; R Studio, which is implemented using the R statistical language; Eclipse IDE for Linux Java and C++, and semi-proprietary IDEs like Enthought Canopy for Python, which includes a variety of data analytics libraries (NumPy, SciPy, scikit-learn, and pandas).

All of the tools mentioned are suitable for numerical backtesting, although due to the fact that the code will run “in the background”, it is not necessary to use graphical IDEs. At this stage, first of all, you should think about the speed of the system. Compiled languages ​​(like C++) are useful when the number of backtesting parameters is very large. In this case, you should always be very careful about each design step, since your system may not be that fast to begin with. In the case of interpreted languages ​​like Python, high-performance libraries (NumPy/pandas) are often used for backtesting.

The choice of language for implementing a backtesting module will be determined by the specific needs of your algorithm and the number of libraries available for that language (more on this below). However, it should not be forgotten that the language used for the backtester and research environment may differ from the tools chosen for the portfolio builder, risk management and trading engine modules.

Portfolio builder and risk management

Many algorithmic traders often underestimate the importance of portfolio builder and risk management. This is a big mistake because these funds will allow you to keep your money on the exchange. With their help, you can not only reduce the number of risky transactions, but also minimize the costs of trading operations by reducing transaction costs.

Thoughtful implementation of these components can have a significant impact on quality and continued profitability. Without them, it is very difficult to create a stable strategy, because the presence of a portfolio collection mechanism and a risk manager make it easy to modify the trading system.

The purpose of the Portfolio Builder module is to identify a set of potentially profitable trades and make those that will bring the greatest benefit - for this, a variety of factors are analyzed (for example, volatility, asset class and sector of the company whose shares are traded). In accordance with this, the available capital is distributed among a variety of exchange instruments.

Portfolio construction often comes down to a linear algebra problem (like matrix factorization), which means that the performance of the mechanism largely depends on the efficiency of the system's implementation of linear algebra tools. Popular libraries include uBLAS, LAPACK and NAG for C++. MatLab has extensive capabilities in terms of operations with matrices. Python uses NumPy/SciPy for such calculations. In order for the system to support a high-quality and balanced portfolio, you will need a compiled (and well-optimized) library for working with matrices.

Another extremely important part of any algorithmic trading system is the risk management module. Risk can take many forms: increased volatility (for some strategies, this is actually desirable), increased correlations between asset classes, server outages, so-called “black swans” (events that cannot be predicted) and undetected bugs in the trading program code - and this is only a small part of the possible problems.

The risk management module tries to “anticipate” the consequences of most of the above risks. Very often, statistical analysis is used for this (for example, stress tests using the Monte Carlo method). Parallelism plays a big role in such calculations, and, in general, performance problems can be solved by simply increasing computing power.

Trading engine

The task of the system's trading engine is to receive filtered trading signals from the portfolio constructor and risk management modules, generate trading orders based on them, which are then sent to the brokerage trading system. In the case of “regular” private traders, this will most likely require an API or FIX connection. Accordingly, to select a language, you need to analyze the quality of the API itself, the presence/absence of software shells for working with it, the expected frequency of transactions and the expected “slippage” between the moment an order is sent to the broker’s system and its appearance in the core of the exchange trading system.

The “quality” of an API consists of several elements: the quality of documentation, the performance that the interface provides, whether separate software is needed to work with it or whether a connection can be established without a GUI, etc.

Most brokerage APIs have interfaces in C++ and/or Java. Typically, a community of broker client users is formed around each such tool, who help develop it and create wrappers for C#, Python, R, Excel and MatLab. However, it is necessary to remember that any additional plugin may contain various errors, so they should always be thoroughly tested and make sure that the developers are engaged in supporting their creation. The best way is to look at how often updates have been released in recent months.

The frequency of trading operations is the most important element of the trading engine algorithm. A robot can send hundreds of orders per minute, so system performance is extremely important. If the system is not implemented very well, then significant slippage is inevitable between the price when the order should have been placed and the one at which it was actually executed. This can have a dramatic impact on profitability.

Statically typed languages ​​(see below) like C++/Java are usually best suited for writing a trading engine, but their use raises issues with development time, ease of testing, and code maintainability. On the other hand, dynamically typed languages ​​such as Python and Perl are now "pretty fast". Make sure that all components of your system are designed using a modular approach that makes it easy to remove and add new elements to the system over time.

Architecture planning and development process

We have already discussed the components of a trading system, the importance of trading frequency parameters and their volume, but have not yet touched on infrastructure issues. An independent private trader or employee of a small HFT company or fund will likely face many challenges - alpha model analysis, risk management and execution parameters, as well as the final deployment of the system - all of which must be done independently. All this important points, so before diving headfirst into discussing programming languages, it's a good idea to discuss the optimal system architecture.

Separation of Interests

One of the most important tasks when creating a trading robot is the “separation of interests” or, in software development language, the separation various aspects trading system for modular components.

This separation into components will help in the future to change/replace/add new modules to the system to improve performance, reliability or make it easier to maintain, without having to check all the dependencies and “whether anything is broken” in other places. For trading systems, this approach is the best practice. For systems that operate “at medium speeds” its implementation is highly desirable. In the case of HFT systems, some rules may have to be ignored in order to achieve even higher speed, but in general, it is worth sticking with this approach.

Creating a component map of an algorithmic trading system is a topic that deserves a separate article. However, the optimal approach here is to implement separate components for historical and real market information, data storage, API access, backtesting module, strategy parameters, portfolio builder, as well as risk management module and the trading engine itself.

For example, if problems with the efficiency of working with a data warehouse are discovered (even after optimization work), then such a module can be easily replaced with almost complete absence the need to rewrite anything in the data reception or API access components.

Another plus modular scheme is that it allows use in different parts of the system different languages programming. There is no need to be strictly tied to a specific tool if the method of communication between the system components is independent. For example, they can communicate via TCP/IP, ZeroMQ or other protocols.

A specific example: a backtesting system could be written in C++ to achieve high performance, while the portfolio manager and trading engine could be written in Python using SciPy and IBPy.

Thoughts on Performance

Performance is important for almost any trading strategy. The higher the frequency of the trading system, the more important role this factor plays a role. “Performance” refers to many things, including algorithm execution speed, network latency, communication channel, data input/output, multithreading/parallelism, and scaling. Separate books are devoted to each of these aspects, so we will only briefly touch on them. We will now discuss architecture and specific programming languages ​​in terms of their impact on overall system performance.

Donal Knuth, one of the fathers of what we call Computer Science, said a very wise thing: “the root of all evil is premature optimization.” This is true almost always, but not when developing an HFT trading algorithm! If you are interested in creating a lower frequency strategy, then general approach in your case it will be to build the system in the most in a simple way and start optimizing it only when bottlenecks are discovered.

To identify them, various profiling tools are used. You can create profiles both in MS Windows and Linux. There are a whole bunch of different tools for this. Now, as agreed, we will discuss specific programming languages ​​in the context of performance.

C++, Java, Python, R and MatLab all have high-performance libraries (both internal and external) for basic data sets and algorithmic work. C++ comes bundled with the Standard Template Librar, and Python includes NumPy/SciPy. You can find standard math problems in these libraries, and writing your own implementation is a path that can rarely be called profitable.

An exception is the case when you need unique equipment and you use an algorithm that works with some proprietary extensions (like custom caches). At the same time, you need to remember that reinventing the wheel often takes up time that can be spent with much greater benefit on developing and optimizing all parts of the trading system. Development time is priceless, especially if you are creating your system alone.

Latency is often an issue for a trading engine since the market analysis tools are usually located on the same machine. Delays can occur at any step of the execution process: database accesses are in progress (disk/network delays), trading signals must be generated (OS or kernel delays), orders must be sent to the exchange (communication channel delays) and they must be processed by the core of the exchange trading system ( stock exchange delays).

To create an effective HFT system, you will have to understand kernel-level optimization and optimization of data transfer processes.

Another useful tool for the developer of high-speed stock exchange robots is caching. The main idea behind caching is to store frequently requested information so that it can be retrieved without wasting resources. In web development, for example, caching can be used when loading data from a relational database on disk into memory. All subsequent queries to this data will no longer need to be sent to the database, which can significantly improve system performance.

For online trading, caching can also be very useful thing. For example, you can save the current state of the portfolio in a cache and keep it there until the instruments in it are “rebalanced,” which will avoid the need to generate a list of purchased and sold assets anew each time the algorithm is triggered - it can simply be updated. Such an operation requires significant processor and I/O resources.

Unfortunately, caching is not a tool without its problems. Reloading cached data, due to the volatile nature of cache stores, can also require significant infrastructure resources. Another problem is the domino effect, in which, under high load, several copies of the cache are mistakenly started to be generated, which entails a series of failures.

Dynamic memory allocation is an expensive operation. Therefore, high-performance trading applications must be good at working with memory and be able to allocate and take it away at all stages of the program flow. Newer programming languages ​​such as Java, C# or Python have automatic garbage collection, thanks to which memory is allocated or deallocated dynamically.

This tool is extremely useful during development because it reduces the number of errors and increases the readability of the code. However, for some HFT systems it is still better not to use standard tools for working with memory, but to implement your own. For example, in Java, with the help of some tuning of the garbage collector and heap configuration, you can improve the performance of HFT strategies.

C++ does not have native garbage collector tools, so it is necessary to manage the allocation and release of memory during the implementation of objects. This, of course, makes bugs more likely to occur, but it also allows for greater control over objects and heaps in specific applications. When choosing a programming language, take the trouble to learn more about how garbage collection works in it, and whether it is possible to somehow optimize the operation of this mechanism for specific scenarios.

Many operations in algorithmic trading can be parallelized, that is, different program operations can be executed simultaneously. So-called "staggeringly parallel" algorithms involve steps that can be performed completely independently of other steps. Specific statistical operations, such as Monte Carlo simulations, are good examples such parallel algorithms, since each probability and the course of events when it occurs can be calculated without knowledge of other possible ways of developing the situation.

Other algorithms are only partially parallelizable. Algorithms of this type include modeling in fluid dynamics, where the domain of calculations can be divided into separate domains, but they still must be connected to each other. Parallelizable algorithms obey Amdahl's law, which imposes a theoretical upper limit on the performance improvement of a parallelized algorithm when there are N separate processes (for example, on a processor core or in a thread).

Parallelization has become an important optimization element as processor clock speeds have not increased recently and new processors contain more and more cores that can perform parallel calculations. Advances in graphics hardware (especially for video games) have also led to improvements in GPUs, which now contain hundreds of “cores” to handle multiple simultaneous operations. And the price of such GPUs has become much more acceptable. High-level frameworks like Nvidia's CUDA have become widespread in science and finance.

Typically, such GPU devices are suitable only for research tasks, but there are also those (including programmable FPGAs) that are used directly for HFT. At the moment the vast majority modern languages programming programs support multithreading to one degree or another, which will allow you, for example, to optimize a backtester so that it uses processes independent of each other.

Scaling in software development means the ability of a system to cope with ever-increasing loads in the form more requests, higher CPU load and more allocated memory. In algorithmic trading, the strategy is “scaled”, meaning it can work with a large amount of capital and still consistently produce positive result. A trading technology stack is scalable if it can handle higher volumes and handle increased latency without bottlenecks.

Of course, systems should be designed to be scalable, but problems and bottlenecks can be difficult to predict. Strict logging, profiling and monitoring will make the system more scalable. Some programming languages ​​are often described as "non-scalable". In fact, those who say this simply “don’t know how to cook them.” The entire technology stack may be non-scalable, but not the language itself. Naturally, some languages ​​have better performance than others in specific cases, but one language cannot be said to be “better” than another in every sense.

As we said above, we need to share interests. In order for the system to cope with “spikes” (the so-called sudden volatility that causes a large number of trades), it is useful to create a “message queue architecture”. This means that a message queue is placed between the components of the trading system, so that the system freezes if a particular component cannot process many requests.

Hardware and operating systems

The hardware on which your trading system runs can have a significant impact on the profitability of the algorithm. This does not even apply exclusively to high-frequency traders - bad servers can fail at any moment, and it will not matter how many transactions your robot makes if, due to the fault of the hardware, it cannot perform one, but very important operation. Therefore, the choice of hardware for a trading system is extremely important. Typically, the choice is between the user’s own computer, a remote server, a cloud virtual machine, or a colocation server (in the data center of an exchange or broker).

It is clear that the desktop option is the simplest and cheapest, largely due to the existence of a large number of user friendly operating systems (Windows, Mac OS, Ubuntu). But they also have significant disadvantages. One of the main ones is that each new OS upgrade will require patching the trading robot, plus the computer will have to be rebooted periodically, which is also not very good. In addition, the computing resources of a personal computer are spent on maintaining the GUI, but they could be spent on increasing the performance of the trading system!

In addition, working at home or in the office is fraught with problems with uptime and Internet connection. The main advantage of a desktop system is the fact that additional computing power for it can be purchased for an amount much less than what would be required to upgrade a server of similar speed.

A dedicated server or cloud machine will cost you more than a desktop computer, but it will also allow you to organize a much more redundant infrastructure - including automated data backups, the ability to configure uptime and speed monitoring. They will be more difficult to administer, since at a minimum they will require a remote connection.

For Windows servers, RDP will most likely be used, and in Unix-based systems you cannot do without SSH - there is no escape from the command line at all, which makes some development tools like Excel or MatLab inapplicable due to their inability to work without a graphical interface.

A colocation server simply means that you place your server as close to the core of the exchange as possible - in its data center, or in the broker’s data center, which is located in the same place as the exchange system local network. For some HFT strategies, this is the only acceptable option, despite the fact that it is the most expensive.

The final aspect to consider when choosing software and programming language is platform independence. Is there a need to run code on different OSes? Or is the code designed to run on a specific processor architecture - such as x86/x64 - or will it be able to run on ARM RISC processors as well? The answers to these questions will directly depend on the expected frequency and type of trading strategy.

Stability and testing

The best way to lose a ton of money on algorithmic trading is to create an unstable system. Resilience includes the system's ability to respond to rare events such as broker failures (or bankruptcy), unexpected increased volatility, Internet outages of service providers (Internet, data centers), or accidental deletion of the entire trading database. A poorly implemented architecture can wipe out years of successful and profitable trading in a matter of seconds. The key aspects of your trading system should be debugging, testing, backup, availability and monitoring.

When developing a high-quality trading system, do not even expect to spend less than 50% of the total time on debugging, testing and support.

Almost all programming languages ​​come bundled with a debugger or have adequate third-party alternatives. Thanks to the debugger, you can place special breakpoints in your code, which will allow you to study the behavior of the program before the crash occurs.

Debugging is an important tool in analyzing software errors, but it is primarily used in compiled languages ​​like C++ or Java, while interpreted languages ​​like Python are generally easier to debug. However, this language also comes with pdb, a powerful debugging tool. Microsoft Visual C++ IDE has additional funds debugging with GUI, and for Linux C++ you will have to use the gdb debugger.

You can't do without testing. The most modern testing paradigm is TTD or Test Driven Development, in which a test is first written that covers the desired change in the system, and then code is written for it that can pass this test.

Test-driven development is not an easy task and requires a lot of discipline. For C++, there is a unit testing framework in Boost; in Java, there is the JUnit library for the same purposes. Python also has a module for this type of testing, which is part of the standard library. Many other languages ​​also have tools and frameworks for performing unit testing.

In a productive environment, smart logging is absolutely necessary. It is necessary to establish a process for issuing various messages about errors and system behavior. Logs are the first place you will start when dealing with problems and failures. Despite all the apparent simplicity of the task - outputting messages to a file and storing it - in reality everything is much more complicated, and you should think through the design of the logging system before starting to implement it.

Both Windows and Linux have a variety of logging tools and capabilities, and the programming languages ​​also come with logging libraries that will work in most cases. A reasonable solution would be to centralize all reporting information - this will make it more convenient to analyze it in the future.

Logs will give you an idea of ​​what happened in the past, and a monitoring system will provide insight into the current situation. You can and should monitor almost all aspects of your trading system: disk space usage, available memory, communication channel states and processor load are all useful data for a basic understanding of the state of affairs.

In addition, it is worth monitoring purely trading metrics - abnormal volumes or prices, sudden account drawdowns and news affecting certain sectors of the economy or entire countries. The monitor should come with a module that will notify you if any of the parameters are violated. You can use different message delivery methods (email, SMS, robocall to phone) depending on the severity of a particular event.

Typically, a dedicated administrator monitors the system, but if you do everything yourself, you will have to resort to using various tools that will facilitate development; fortunately, there are many paid and free open solutions for a variety of cases.

Backup and system availability is what you need to work on first. Think about the following questions: 1) if for some (terrible) reason the entire database is suddenly deleted (and there are no backups), how will this affect the algorithm for researching and executing orders? 2) If the trading system hangs for a long period of time (if there are open positions), how will this affect the amount of money in the account and portfolio? The answers to these questions are usually scary.

Therefore, it is imperative to develop a system for backup and further deployment of data - this is almost more important than the copying itself. Many traders do not test the saved backups, which entails no guarantee that at the right time this data will be able to be “rolled up” and the system will work as expected.

The same applies to work on system accessibility. Despite the additional costs, be sure to take care of the availability of redundant infrastructure and redundancy - the cost of system downtime can exceed all costs tens of times in a few minutes.

Language selection

We have already covered many factors and aspects that influence the development of a trading system. It's time to talk about programming languages.
Type system
When choosing a programming language for your trading stack, you should not forget about the type system. Languages ​​of interest to algorithmic traders can be either dynamic or static. The latter include C++ and Java - they perform type checking during the compilation process. In dynamic languages, this check occurs on the fly without any compilation. Examples include Python, Perl and JavaScript.

For high-precision systems, which certainly include trading robots, type checking during compilation can be a very advantageous option, since it eliminates a lot of errors that could lead to numerical errors. On the other hand, type checking does not catch all possible bugs, so it is necessary to devote time to exception handling. When using dynamic languages, you often encounter startup errors that would not happen when checking types in static languages. If you do use a dynamic language, then it is worth implementing TDD and unit testing methodology to reduce the number of possible errors.

Open source or proprietary software?

One of the main decisions that a developer of algorithmic trading software will have to make is whether to use commercial software or resort to open technologies. Each of these paths has its pros and cons. It is necessary to study how well the language is supported, how active the community is that develops it, whether installation and support is easy, how high-quality the documentation is presented on the network, and calculate any possible costs for licenses and use of the product.

The Microsoft .NET stack (including Visual C++, Visual C#) and MathWorks from MatLab are the main proprietary tools for developing trading systems. Both systems have been tested by thousands of traders around the world on various exchange platforms.

Data software products are fully and well documented and have a large active community interested in the development of these tools. .NET software allows integration with many programming languages ​​such as C++, C# and VB, and also quite easily connects to other Microsoft products such as the SQL Server database (via LINQ). MatLab also has many plugins and libraries (some of which are paid) that can be applied to almost any area of ​​financial computing.

But there are also limitations. The main one is the price, which may be unaffordable for a single trader (although Microsoft also gives the basic version of Visual Studio for free). Microsoft products work well together, but integrating them with any third-party systems is not at all easy. In addition, Visual Studio only runs on WIndows, which can be blamed for poor performance compared to a similarly powerful, well-tuned Linux server. MatLab is missing some plugins that could make the product easier to use.

The main disadvantage of proprietary products is the lack of access to the source code. This means that when you need ultra and mega performance, you will not be able to tweak anything in them, and therefore, you will be limited.

Open source products are also very common in the financial industry. For example, Linux, MySQL/PostgreSQL, Python, R, C++ and Java are used where high performance is needed. However, none of these funds can be called “tailored” to this specific market. Python and R contain many redundant libraries that can perform almost any possible calculation at speeds comparable to compiled languages ​​(with certain caveats, of course).

The main advantage of using interpreted languages ​​is the speed of development. Python and R require far fewer lines of code to achieve similar functionality. In addition, they also often allow interactive console based development, which greatly speeds up the sequential development process.

Considering the fact that a developer’s time (especially if he is a lone developer) is very valuable, and the speed of everything in HFT always comes first, it is worth taking a closer look at the open source technology stack. The same Python and R have an impressive community, and, due to their popularity, are well supported. In addition, there is a huge amount of documentation on them.

However, open source software often does not have commercial support, as is the case with proprietary products, and they work on much less user-friendly interfaces. On a Linux server you will almost never see a graphical management interface; everything will have to be done through the console. And for some tasks, languages ​​like Python and R can be too slow. There are mechanisms for integration with, for example, C++ to improve speed, but this requires some experience in multilingual programming.

Despite the fact that in the world of proprietary software you can encounter problems when updating product versions, in the case of open source software such difficulties are much more common. Generally, open systems more difficult to administer.

What's in the box

What libraries does the language contain and how good are they? This is where older languages ​​have an advantage over newer ones. C++, Java and Python have been developing for many years and have an extensive set of libraries for network programming, HTTP, interactions with the operating system, graphical interfaces, libraries for regular expressions, and so on.

C++ is famous for its STL (Standard Template Library), which contains many high-performance data structures. Python is known for its ability to work with almost any type of system and protocol (especially on the web), through its own standard library. R has a lot of statistical and econometric tools built-in, and MatLab is great for writing linear algebra code (this can be found, for example, in portfolio optimization engines and pricing calculations).

If you urgently need custom programs, use the YouDo service to find an experienced programmer. There are verified masters registered on the Yudu website who are ready to make programs of any subject with functionality of any complexity. Yudu specialists have relevant experience and offer low prices for services.

What services are included in the work of the master?

When running a business, sooner or later the need for high-quality software arises. Existing software products may not meet your company's requirements. In this case, you can order the creation of a computer program with a license, which will be made exactly to your requirements.

Experienced programmers typically create a program like this:

  • draw up a work plan and detailed technical specifications
  • develop functionality and interface
  • create a convenient and understandable control system
  • testing the resulting product
  • provide customer training on software management and use

Professionals will make computing and any other software for Windows, iOS, Android and any other operating systems.

You will need to tell the programmer in as much detail as possible about your wishes and requirements for the program. This will help the specialist complete the order efficiently in the most short time at low price.

Creating programs takes about one month, depending on the complexity of technical and other issues. Craftsmen begin writing software immediately after the technical specifications are approved.

The cost of a programmer’s work depends on parameters such as:

  • complexity of technical specifications
  • type of operating system for which the product is being created
  • urgency of development
  • the need to provide additional services

Study the prices on the Yudu website to find out approximate prices to work as programmers. The professional will name the exact cost of the order after receiving or developing the technical specifications and discussing all other details of the order. Before work, an agreement is concluded with the master, which will guarantee safe cooperation.

Our experts work online and are ready to answer your questions at any time of the day.

How to order development

If you need computer programs to order at a low price, fill out an application through the Yudu website. Indicate your requirements for the work and the craftsman, as well as the maximum cost of production. Programmers who are ready to develop a program cheaply and professionally will leave you their feedback. After studying the price lists and offers, you can choose the right artist.

View programmer profiles on the Yudu website to find out how much it costs to make computer programs according to the price list. With the help of reviews from previous clients, you will understand which professionals have proven themselves well. The rating system will make it easier to find the best craftsmen who cheaply make custom programs.

Sergey writes 08/08/2019 00:05:
>Writing any custom programs. 2 Diplomas from MEPhI (Moscow Engineering Physics Institute) - mathematician and programmer. 25 years of professional programming experience. An expert of the highest class, he has worked abroad for many years in world-famous companies. Languages ​​C, C++, C#, Java, JavaScript, HTML, Pascal, Delphi, Visual Basic, Excell, Assembler, Assembler for microcontrollers (AVR, PIC, x51, x80-86). Databases - any, including Oracle, MS SQL Server, InterBase, DB2, Paradox, Access, FoxPro, any, client - server. Microcontrollers ASSEMBLER (all dialects) - 8080, 8085, Z80, x51, AVR, PIC, Arduino. Computer graphics 2D, 3D - OpenGL, DirectX. Creation of websites of any level of complexity.

Greetings. I am interested in writing a trace program.
Bot program for automatic bets in a bookmaker's office
Not for betfair. The program should perform a number of actions, everything should look something like this:

1. Go to the application, press the button, the required rates (forecasts) are parsed from the mailing address (a new letter arrives every day). Perhaps we display them in a separate window or form in the program.

2. Based on the received bets (forecasts), the program automatically places these bets with a certain time interval on several accounts in the bookmaker.

3. There can be one or several account in BC. Ideally, you can simply enter accounts into the program and check the boxes which account to use and which not.

4. The time between bets should be random, but no less and no more than the range that can be specified in the settings. For example: the interval is set from 1 to 5 seconds. 1 bet - boom, second after 2 seconds, third after 3.6, fourth after 1.7, etc.

5. The bookmaker’s website also needs to be parsed into the program window and select only the desired line and the desired events. I don’t know how to implement this, the programmer must figure it out. For what? Sometimes a certain team name in the forecast may differ from the name in the bookmaker. Therefore, it will not be possible to place a bet automatically. Let's look further.

6. If, nevertheless, some bets could not be placed automatically, the program should allow the user to place them manually as quickly as possible. Those. for example, 8 out of 10 bets were placed successfully, then a window appears which bets were not made - the user in the program already sees the parsed line with the necessary events and can place it manually with one click. Those. Click once on the desired bet - and the bet will be placed from all accounts.

7. The amount of bets is set in the settings and is the same for all bets.

8. If the odds, the size of the handicap (i.e. the bet itself) or the maximum bet amount have changed during the operation of the bot, then: a) if the odds change, bet at the new odds if it is not equal to 1.01 (but in principle this is not it happens, it can fall from 1.9 to 1.7) b) in case of changing the size of the handicap, give the user a window with a new handicap, where the bet and the new handicap will be visible, you can click ACCEPT or CANCEL c) in case of changing the maximum bet (can change from 50 to 0.01 for example) also accept a new amount if it is not less than N (it is advisable to add this to the settings).
This may not be all that is needed, but it is at least 90%. Please clarify any questions during development. Of course, it won’t be that the program will need to be changed upside down, but I think some modifications will be required. Ideally, this should be a three-click program: open the program, parse bets, place bets. I’ll give the bookmaker’s website to the programmer personally, and then I’ll show you in what format the letters are received and which line from the bookmaker needs to be parsed. Develop the program so that you can make updates in the future, we will cooperate for a long time

Creation of custom programs for Windows and nix


Here you can order a program for your computer; Examples of already created programs are on the website in the appropriate section. In addition, I am ready to show other completed works - those that the customers allowed to be shown. You can also read reviews about me, for example, on freelance or directly on mine.

In what main languages ​​can I write a program for you:

  • C#NET;
  • Java;
  • C++;
I am also familiar with other programming languages ​​(varieties Basic, variations Pascal), have experience working with tools Qt, I can program for the web (php); it is possible to understand almost any other existing language or modern technology. It’s not for nothing that the title states that I can write programs for more than one OS: I like programming in Java (as an option - Qt), this allows me to run created applications on various systems. Including Mac OS, but I admit, I don’t have much experience working with it, so we limit ourselves to Windows and nix.

Why is it worth ordering a program for WIndows or nix from me?

  • Prices. In each case, we negotiate with the customer separately, the cost of the work (I don’t like hackneyed phrases, but there’s nowhere to go) will pleasantly surprise you. And one more thing: I take a minimum advance payment, and if you have any recommendations, reputation or something else similar, then I may not ask for an advance payment at all. Prices are below the bottom.
  • Confidentiality. As you can see for yourself, I do not have any programs completed for customers on my website (however, sometimes there may be solutions to problems that customers have allowed to be posted publicly). And not because they don't exist, but because I respect privacy. If you do not have such a desire, then no one will ever know that the program was written by me. I don't strive for fame, I'm only interested in programming itself and a small monetary reward for it.
  • Guarantees. I have been working in this field for several years now, the same reviews about me on freelance exchanges are confirmation that I am not disappearing anywhere. After transferring the program to you and payment, I will not disappear: you can contact me at any time for help, clarification, addition or revision. If something in the program is done incorrectly (on my part), then I will correct it. Free, of course.
  • Deadlines. I don’t miss deadlines, my grandmothers don’t die, my cat doesn’t give birth unexpectedly, and my nephews don’t appear in Burkina Faso. At least while I'm working on a project for you. Force majeure can happen to everyone, this is natural, but so far they have passed me by.
  • Enthusiasm. I really like making programs, writing code. Unlike full-time programmers, the creation of applications is not put on stream; I do it “on the hunt”, with enthusiasm. I won't undertake to make an application if I'm not interested in it. But if I take it on, rest assured that the program will work. And in the right way.
  • Experience. I have more than a dozen completed applications behind me - from simple laboratory work and to rather complex DBMS interfaces. This allows you to use best practices, reduce deadlines and sometimes prices.
  • Broad specialization. I have knowledge in a wide variety of programming areas. This means that you, as a customer, will not have to hire different people. For example, I can not only create the layout of your website (frontend), but also adjust the database and expand functionality (backend).
You can contact me by email [email protected], Skype up777up2 or simply by sending an email. Don't forget to include your email address, Skype, ICQ or anything else so that I can contact you for a response.

Even if you don’t need anything right now, bookmark the page - maybe it will come in handy :)

In this article I will tell you in detail and show you how to write a trading robot, which was discussed in the previous article. This will be the first and simplest lesson on creating stock exchange automatic systems. But, despite this, having performed exactly all the steps described by me, the result will be a real trading robot.

I won’t pour water, but will get straight to the point. So, the first thing you need to do is download and install Delphi 7. This can be done using the link - . After that, open the folder with the shell program. The program can be viewed and ordered using the link:

We are interested in the TradeRobot.dpr file. We open it and see what is shown in the picture below.

The window that says “Robot” is Form1, a Windows window in other words. This is how it looks in the developer. On it we need to place the robot’s controls and controls, such as: two buttons and three small row windows. The first button will be responsible for connecting to QUIK, the second will be responsible for starting and stopping our robot. The window lines will display information about the volumes of recent purchases and sales and the current status of the program.

To place the necessary elements on the form, you need to click on the button in the Standard tab.

After that, click anywhere on the form. Delphi will offer to rename the button and we will use this. Let's call it ConnectButton.

Let's create a second button in the same way and call it StartButton.

Now let's create 3 row windows. To do this, in the same Standard tab, select the appropriate icon (as in the picture) and place it on the form.

We repeat this three times and call them as follows:
- upper left BuyVolumeEdit
- top right SaleVolumeEdit
- lower StatusEdit

Now you need to change the labels on the elements. This is done in the ObjectInspector window, for buttons in the Caption line, for row windows in the Text line.

It should look like the picture below.

Now we need to write a script for each button. To do this, double-click on the Connect to QUIK button and the code will open, as in the picture below.

Before begin, insert the following text:

Var EMsg: Array of char;

EMsgSz:DWord;

EMsgSz:=255;

ExtEC:=0;

rez:=-1;

path:= "C:\Quik-Junior-Zerich\";

FillChar(EMsg, SizeOf(EMsg), 0);

rez:=connect(PChar(path), ExtEC, EMsg, EMsgSz);

Massage:= ResultToString(rez and 255);

if Massage = "EXECUTE" then begin StatusEdit.Text:= "Connected...";

Status:= "Connected...";

end else begin StatusEdit.Text:= "Failed...";

Status:= "Failed...";

end;

The result should be the following:

The path to QUIK is marked with red underlining. If yours is different, then change the path in this place.

Now let's move on to the START button. Open the script by double-clicking and insert the following between begin and end:
If StartButton.Caption = "START" then begin Status:= "Started";

StartButton.Caption:= "STOP";<>end else begin Status:= "Stopped";<>StartButton.Caption:= "START";

end;<>StatusEdit.Text:= Status;<>It should look like this:<>Now let's write global variables. To do this, let's find part of the code:

rez:=connect(PChar(path), ExtEC, EMsg, EMsgSz);

And insert the following code:

DataTable: array of array of string; BuyVolume, SaleVolume: Real; Status: String;

Transaction:="ACTION=NEW_ORDER; TRANS_ID=1; CLASSCODE= SPBFUT; SECCODE= SiU6; ACCOUNT= SPBFUT00553; CLIENT_CODE= ; TYPE=M; OPERATION= B; QUANTITY=1; PRICE=0;";

in the ACCOUNT= parameter you need to specify your account. Now my SPBFUT00553 is listed there.

That's it, the robot is written. Now all that remains is to compile it, i.e. turn into a ready-made EXE application. To do this, click on the green Run (or F9) button, similar to Play.