Can we make quantitative trading without code? Let's find out...

Can we make quantitative trading without code? Let's find out...

·

6 min read

NO.1

On Wall Street, quantitative trading has become the leading role of market trading. Many of the world's top investment banks have banned manual directional speculative trading. The development of quantitative trading in China is also very rapid. Institutions are using it, and future tycoons are also using it. There are more and more people participating in quantitative trading.

But there are also many manual traders who are interested in quantitative trading. At the beginning, they were full of confidence. After reading the long and complex code, they often hesitated or stopped. In order to popularize the public, reduce the threshold of quantitative trading programming, and improve the efficiency of writing greatly, FMZ has developed a visual quantitative trading platform.

NO.2

In traditional programming, you should be familiar with the basic grammar, data operation, data structure, logic control... of programming language. Let's write a program that outputs "hello, world" in Java to experience traditional programming, as follows:

It took 5 lines of code just to output a string program. I believe that most beginners only know the "hello, world" in parentheses, and nothing else. Therefore, it is a better choice to start with visual programming.

Visual programming has a long history and is not new. The "what you see is what you get" programming idea, carrying various control modules, can build code logic and complete trading strategy design just by dragging, and the process is very like building blocks.

As shown in the chart above, the same program needs only one line of code in blockly visual programming, which reduces the programming threshold greatly, especially for those traders who do not understand programming at all. This is a very good operating experience. The FMZ Quant visual programming is also realized through the blocky visualization tool released by Google. In design, it is the same as the Scratch launched by Massachusetts Institute of Technology, so there is really - no barrier.

The FMZ Quant visual programming, with hundreds of commonly used trading modules built in, will have more trading modules added in the future to support traders' new ideas and new applications, which will be jointly developed and maintained by developers. Although the grammar is simple, it does have performance. It can almost meet most quantitative trading strategies. In terms of function and speed, it is not inferior to conventional programming languages such as Python and JavaScript. In the future, financial applications with complex logic will be supported.

NO.3

How to use

Step 1: Register and sign in the FMZ Quant (FMZ) website at: www.fmz.com

Step 2: Go to Dashboard

Step 3: Click add strategy

Step 4: Select Blockly and Template Include

Finally, we are in the visual programming interface, as follows:

NO.4

Try to write a program that outputs "hello, world" using the FMZ Quant blockly editor

Step 1: Select Log module

Step 2: Select Text module

Step 3: Backtest settings

Step 4: Backtest result

NO.5

A complete dynamic balancing strategy for digital currencies

Strategy logic

  • Condition for buying: If the market value of the current position minus the current available balance is less than 5% of the negative current available balance, open a position to buy.

  • Condition for selling: If the market value of the current position minus the current available balance is more than 5% of the negative current available balance, close a position to sell.

Prerequisites and requirements

  • Current market

  • Current assets

  • Total market value of currency

  • Asset difference

Blockly strategy-writing Step 1

We calculate the four prerequisites and prerequisites of the trading strategy and assign values to each variable. With visual programming, the code block is like this, as shown below:

It should be noted that the total market value of the currency is the total market value of the current currency holdings. The calculation method is to multiply the current total currency holdings by the current latest price. The asset difference is the total market value of the currency minus the current available balance.

Blockly strategy-writing Step 2

After the assignment of prerequisites and prerequisites is completed, the trading logic needs to be written. This is not as complicated as expected. It is nothing more than to express the above strategy logic in the form of code blocks. That is, if the asset difference is less than 5% of the negative available balance, buy it, and if the asset difference is greater than 5% of the available balance, sell it. As shown below:

The whole strategy seems to have finished, but you should know that the program is executed from top to bottom, and then it stops. However, our trading strategy is not to execute the trading conditions once, but to execute them in a loop repeatedly. In other words, the program needs to check whether the strategic conditions have been reached constantly. If so, it will execute the trading, otherwise it will continue to check. At this time, another loop statement is needed, as shown in the following figure:

There is no essential difference between the visualization strategy and the strategy written in other programming languages. It also supports the historical data test with multiple periods and accuracies. Of course, it also supports the real market trading of domestic and foreign commodity futures and digital currency. The following is the backtest information of the strategy:

So far, a complete trading strategy has finished. In order to take care of the lazy guys, this strategy has been shared in the strategy square and it can be copied for study directly.

Strategy link address:

https://www.fmz.com/strategy/121404

NO.6

The law of ten thousand hours always exists, but for traders with zero basis, it is impossible to spend ten thousand hours practicing again. So you must have a ladder, and for traders with zero programming foundation, the FMZ Quant visual programming is a ladder to get started quickly.

With visual programming, you don't need to remember the grammar and method name, just simply browse the function module to find what you want. The original intention of the FMZ Quant is also to help more quantitative beginners reduce the entry threshold and increase their interest in quantification. Everyone can become a quantitative trader!

However, in other words, visual programming is no problem as a step to quantitative entry, but it also has its own limitations, such as the inability to develop overly complex and sophisticated trading strategies. But this does not affect you to take the first step of quantitative trading!

Finally, I wish all friends who want to do quantitative trading, regardless of whether they are based on zero, can achieve their learning goals through action. Thank you for reading!

From: https://blog.mathquant.com/2023/02/13/can-we-make-quantitative-trading-without-code-lets-find-out.html