You can create countless strategies and backtests in Ptrade, but if you want to run real-time strategies, you can only run 5 at the same time. After more than 5, you will be prompted to stop some of the running strategies before you can add a new strategy.
In the code, if multiple strategies are running at the same time, it is necessary to distinguish the orders under different strategies at the code level, otherwise conflicts will occur. For example, your order under the first strategy is cleared by the second strategy. So how to distinguish between different strategies to place an order?
1. If it is an intraday strategy, you only need to use a dictionary dict to record each purchase record, and each sale target must be in the dict.
2. Persistence. Although the Ptrade of most brokerages does not support networking, local persistence, pickle or sqlite can be used. Save locally in the cloud.
In fact, if we want to do quantification, there is no need to be limited to Ptrade. After all, the threshold is relatively high. I can also try other quantitative trading interfaces, which also support localization, such as the following:
name |
Function |
|
basic function |
Init |
|
Deinit |
||
Logon |
||
logoff |
||
QueryData |
||
QueryHistoryData |
||
SendOrder |
||
CancelOrder |
||
GetQuote |
||
Repay |
||
GetExpireDate |
There are many quantitative trading interface projects now , and we can also find them on code hosting platforms, such as here: https://gitee.com/metatradeapi. Quantitative platforms like Ptrade are good, but in fact, after careful understanding, you will find other options Not less.