Author of this article: Bit Pig

Disclaimer: This article only represents personal thoughts and does not constitute any investment advice. Do not believe that contracts can make you rich overnight. There is no such thing as getting rich overnight in the cryptocurrency world.

Unchanged strategy: Make stable money in the long cycle through fixed investment and bottom-fishing BTC and ETH (fixed investment has been stopped for the time being) + try high-risk and high-return with short-term funds.

0x00 Introduction

Friends who have been following me all along know that I hate contracts very much, and I have always believed that contracts are gambling (still do). Recently, when I was chatting with someone next to me, he proposed some ideas and strategies for contracts, through which the contract winning rate can be kept at 100%. Based on his ideas and strategies, I re-added a lot of my own ideas. My friend's idea requires manual operation, and I have programming skills, so I can completely convert these ideas and strategies into code and write a contract trading robot to work for me 24 hours a day.

Because people have emotions, no matter how experienced a contract trader is, when faced with an extreme one-sided market, he or she may become emotional and deviate from his or her strategy, resulting in misjudgment. However, the contract trading robot has no emotions, it will only execute your customized strategy mindlessly. It is a good idea to have a 24-hour free worker who does not need a salary to help you watch the market for free.

Then I spent several days learning about contracts, how to play contracts, what long and short orders are, etc. I couldn't help it because I really didn't understand. It has been 12 years since I came into contact with Bitcoin, and I have never even opened a contract account.

0x01 Policy Customization

I will not disclose the detailed parameters and details of the strategy, but only my overall idea:

1. The rise and fall of big currencies such as BTC and ETH are very stable. There are often spikes in the bull market, but the overall trend is still upward, so our strategy is mainly long.

2. Crawl a large number of websites related to the cryptocurrency circle and obtain information, and let gpt analyze it. For example: crawl Binance’s announcements, and when new coins are launched, place long orders directly.

3. Predict possible future events, and when they occur, immediately go long or short. For example: Iran and Israel

4. When extreme market conditions occur, it is necessary to make an iterative ordering strategy to avoid liquidation (at the same time, the margin mode needs to be set to position by position)

The overall design idea is: Quantitative + AI news analysis

0x02 Technology Selection

At first, I thought that Binance's grid trading and built-in trading robots could meet my needs. However, after research, I found that all the trading robots that come with the exchange can only meet less than 10% of my strategy requirements. So I decisively gave up the functions that come with the exchange. It seems that I can't be lazy and I have to write the code myself.

After determining that the trading robots provided by the exchange did not meet my needs, I set my sights on tradingview, because it is the most famous quantitative trading software, and I can write my own script code for quantitative trading. However, after studying it, I found that it has too many limitations. It is always the so-called various indicators in traditional quantitative trading, various MACD messes, and the code is written in its own language. It has too many limitations, so I gave up.

After a round of selection, I decided to use python + ccxt + langchain to implement all the core logic myself, and for real-time push of robot operation information, I decided to use coin or WXPusher to push it to my WeChat.

0x03 Real-time testing keeps hitting the pit

In the process of coding, the most difficult part is crawling the data source code, because data sources with strong technical capabilities, such as Binance, will do anti-crawling processing in places such as news pages, which requires some technology to solve its anti-crawling mechanism. In addition, the organization and compilation of various data sources such as the US SEC official website and the Federal Reserve official website is also a physical job.

Trading robot 1.0 launched (real account: Leek Hunter)

I spent two days writing the first version of the robot on March 27. This version only implemented long order quantification (only one order can be placed, no short orders are supported) and simple AI news analysis. I put a small amount of funds into the first sub-account to start testing. The following picture shows the robot starting to work and helping me place orders and make money on March 28.

Trading robot 2.0 is launched (real account: Lao Fei Catch Insects)

After running stably for 2 days, I spent a few more hours developing version 2.0. This version did not make any strategic adjustments, but only enhanced the robustness of the code. Since I didn't know whether the new version was stable, I opened another sub-account and put in a small amount of funds to test version 2.0.

One battle to become a god

In the early morning of April 12, my robot monitored the good news that CB had launched the PEPE contract, and directly placed an order for PEPE, making a profit of 49% in one order. At this time, the 7-day profit of my first real account was 13% (leek hunter), and the 30-day profit was 85.88%. The winning rate was not 100%, because when I was testing the long and short positions, I would incur some losses.

The picture below is a screenshot of monitoring CB online PEPE and then placing an order.




After 14 days of operation, my second real account had a profit of 39.79% and a winning rate of 100%. My colleagues and friends were slightly amazed at my performance, which gave me a great sense of achievement.




The first Waterloo

Also at noon on April 12, a bug appeared in my version 1.0 code, and the Leek Hunter robot began to place random orders. Because I was busy with work that day, I didn't check the push notifications on my phone, nor did I pay attention to the situation of the robot, which eventually led to a liquidation. The test funds of the No. 1 robot were all reduced to zero. Although it was only a few hundred yuan, it was really uncomfortable to completely liquidate because of the failure to deal with the bug in time.


PS: There is another interesting thing here. My position did not get liquidated when it was -150%. I thought it was very strange and asked my friend. My friend said it was because I set the full position mode. This made me learn that there are full position, position by position, joint margin, u-margin and other things.

But I also learned a lot:

1. For a one-position order, you only need to pay if one order is over, but for a full-position order, the entire account can help you handle the order.

2. In order to avoid risks, the trading robot must automatically help me set up position by position before placing an order.

3. It has been running stably for nearly 20 days. The reason for the liquidation is a bug, which shows that my ideas and strategies are fine.

4. I have my own unique understanding of the knowledge and code implementation of contracts

Second Waterloo

In the extreme market on May 1, the No. 2 trading robot (Lao Fei Catcher) was directly liquidated because it only supported one order and did not support iterative orders. Although the position was lost, the winning rate remained at 88.89%.


0x03 Who will compete with the wind (GOAT is born)

Rebirth: Trading Robot 3.0 (Real Account: Wind Listener No. 2)

Adjusting my mood, I started to refactor the code. This time, I debugged every detail countless times. It took me a week to iterate 43 versions, and finally wrote the most powerful trading robot "Listener". In addition to the original strategy, this version also adds a large number of new strategies such as iterative order placement, gpt judgment, automatic long and short orders based on news, etc. It comes with more than 300 line strategies by default, and supports unlimited extension of adding strategies at any time. In addition, I also wrote a simple web backend, so that I can adjust the strategy at any time, stop the robot at any time, and check the robot's running log at any time even if I only have my mobile phone. This third-generation trading robot officially started running on April 23. The following figure shows the running interface of Listener.



All running log information will be printed out and can also be viewed on the mobile phone.



AI analysis is more accurate. The picture below shows that OpenAI’s good news was not captured and an order was placed.


Since its launch on April 23, it has been running stably for 18 days, with a win rate of 100%, a profit of 73.54% this month, and a total profit of 41.85%. Especially in the extreme market conditions on May 1, the Wind Listener delivered a perfect score. Let me be narcissistic, I think the Wind Listener is the strongest trading robot at present, no doubt about it, it is the GOAT (Greatest of All Time) among trading robots, hahahahahahahahahaha.







0x04 Summary

All the above data are real-time and open to everyone on Coin. Later, I will consider opening a real-time platform for experiments directly on Binance.

In fact, this is a technical article, or more precisely, an article combining technology and finance, sharing the results of my two-month experiment. Although I am very satisfied with this trading robot, with a 100% winning rate and high returns, I still think that contracts are a gamble, but it can improve the winning rate through your strategy. Just use the robot to make money for buying groceries. Don't use large funds to play this. I still recommend that you don't touch contracts. In the process of playing contracts, I have never placed an order manually. When certain market conditions appear, I have overcome the urge to place orders manually many times, because I know that as long as there is a first time, there will be countless times. Human nature is a weakness that only machines do not have. Among my friends who follow me, if you have better technology, you can also try to make your own trading robot, and you are also welcome to discuss with me.

#合约挑战 #BTC走势分析 #策略