Can we make quantitative trading without code? Let's find out...
Tags: trading, fmzquant, programming, visual
Published: 2024-05-22 02:17:46

### 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:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gm9l8wzb77ocu2myaugn.png)

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.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8qxgpqemeu4maxhg5ir5.png)

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.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vrymohohhjptbl2cb1dt.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf5pntrdfdfzz0yxk62f.png)

**Step 2**: Go to Dashboard

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cza5kxfr9bgq418trfgn.png)

**Step 3**: Click add strategy

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/arramg2ud2m4o7lk8ptp.png)

**Step 4**: Select Blockly and Template Include

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ztjx1nzm1utlm9136w69.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aaqbai9ebp79p5i6iuw9.png)

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

**Step 1: Select Log module**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c93i9u4i0gm39jvdrx37.png)

**Step 2: Select Text module**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p1nq3hnulbivkr3wwryb.png)

**Step 3: Backtest settings**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9sg5x4n9epaxv04sazye.png)

**Step 4: Backtest result**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd9xk389q8fdkqo5vkqh.png)

### 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:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0ehufr7yusthn3ph07j.png)

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:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bo9xbrowxon4qilkjcrw.png)

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:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkb7kw9msge3yaycbsp1.png)

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:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wu8x9hhc5fcmn5pc6xn8.png)

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