宽客秀

宽客秀

Quant.Show的Web3站点,Archives from quant.show

Automatic forwarding WeChat robot for JoinQuant strategies

Recently, I encountered a pain point. Although I can share the strategies I run on JoinQuant with my friends, they are not pushed in real-time. There are two solutions: first, just like before, I can put the strategies on the shelf and let my friends subscribe to them. However, there is no longer a marketplace, and even if there were, putting them on the shelf would require credits. Moreover, subscribing to strategies would cost money, which is obviously not worth it. The second solution is to subscribe with my own WeChat account and then forward the messages I receive. However, on one hand, some strategies require real-time updates, and on the other hand, it consumes a lot of my own energy. So, I developed a Saas WeChat bot that mainly helps me forward strategy messages to my WeChat groups or friends, as shown in the following example:

d2b5ca33bd970f64a6301fa75ae2eb22 7

1. WeChat Account Preparation#

Prepare a WeChat account for sending messages. I applied for an additional WeChat account to distinguish it from the one I usually use.

2. Login to the Host Machine#

Remote login to the host machine, complete the login process for the WeChat desktop version, and execute the main.exe file after entering the host machine. Please note the following:

  • The IP address, username, and password of the available host machine currently need to be contacted separately.
  • Do not disconnect the remote connection to the host machine or log in to WeChat elsewhere during trading, as this will cause the bot to go offline.
  • The remote login resolution needs to be set to 800x600.
  • Keep the WeChat window in the foreground.

d2b5ca33bd970f64a6301fa75ae2eb22 10

d2b5ca33bd970f64a6301fa75ae2eb22 11

3. Determine the Recipient of the Messages#

The recipient of the messages can be a WeChat account or a group (if the group name changes, it needs to be reset). Grouping is currently supported, and the default group is "default," with the file transfer assistant as a member. This can be used for testing by sending the results to your own file transfer assistant. It is recommended to use "default" during the testing phase.

In addition to "default," new groups can be added, and different groups can receive different signals. One bot can connect to multiple signal sources and user groups. Please note that if the recipient is a WeChat account, you must have added that person as a friend, and if the recipient is a group, you must be a member of that group. Note: The group name will be used in the code later, so you need to set it accordingly in the code.

4. Add Bot Program Code to the Strategy#

The logic of the original strategy code does not need to be modified. You only need to add code in the following places. Please refer to the attached document at the end for details.

5. Compile Backtest#

After modifying the strategy code, compile the backtest, and you will see the buy and sell messages of the strategy sent to the specified WeChat friends or groups.

If you are interested, feel free to email me at [email protected] or join the WeChat group (my WeChat ID: chenxuan0122) to exchange thoughts.

WeChat Bot Code Reference Download

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.