Previously participated in the Circle B event-based research group, backtesting data feel quite good, want to try the real disk.
According to past experience, carefully go through the framework, the output of real disk is achievable.
Combined with the part of building a database in the basic course, to form a set of manual live output framework.
If there is any error or optimization, please advise me.
Brief description
The idea of opening a real position is as follows:
First the framework is split into two parts:
- Update the data (0_DataUpdate.py)
- Calculating and outputting the live market (1_StrategyLive.py)
The final operation can then become:
- according to the strategy K line cycle, timed to run the program to obtain data. (* For example, a strategy is a 24H K cycle, then you can start running the whole set of code every night after 0:00, to realize the manual order *)
- After obtaining the data to run the strategy output of the real part of the market
- manual order.
Data Update
For the data update part, I’m going to rely on the undecided FOR cycle and put in all the coins in the binance contract, which is about 140 coins or so.
However, considering the fact that the coins in the contract are updated and downgraded, it is still necessary to update them every few days.
1 |
|
The next step is to merge the acquired data, per coin, into one big table, still with everything undecided FOR loop merging:
1 | import pandas as pd |
Live output
Before outputting the live orders, you need to change the end_date in Config.py in the Hillel framework to the time of day, and then you can rely on reading the PKL file to output the live orders.
Depending on the strategy, the final output will look like this:
When I saw the signal I backhanded an open short and poked it right in! img
Summary
From the acquisition of data, to the output of real trading manually complete the opening position, a set of down my computer within about 8 minutes (8 generations of low-pressure U brain power is not enough! img), because the hold is usually more than 12 hours, the total seems quite feasible.
It is said that the sharing will be a lot more bullish real trading a single piece of open order practice, I manually open a single belongs to the “can run on the line”, I heard that the follow-up Xingda will also talk about the real code, very much looking forward to! img.
ps: the code is in the attachment, because the maximum can only transfer 25M, so the data I deleted, if you still want to use the back test, refer to the basic course, appropriate modification of the code will be able to get the past data.
Updated June 21st
There are a few problems in the current strategy
- **There is an 8-hour time lag in obtaining data for B
*The +8h approach was used in the past courses, but after actually using it I found that it’s better to run it at 8am or 4pm as Xing Da said in the live broadcast
- Manually da baa every night, putting the server is more appropriate*
If it’s our time zone, manually turn on the computer at 0pm every night to run it can still be realized, but turn on the computer at 8am every morning to run it manually and conflict with the work schedule.
- **Server capacity must be large, or manually clear a part of the useless data at regular intervals **
- server at the same time need to assume a certain data storage function, if the time period of 24H, the parameters involved in hundreds, thousands of K line, it will require a fairly long time of data storage.
Solution ideas
- put the framework on the server
- transfer the results of the real trading output by pinning them out
- Optimize the framework a bit more, try to be as short as possible, only about the content of the real market
- Receive the pinned message to open and close positions manually every day (code has been attached)