Wondertrader releases version v0.5.0


Today (July 28, 2020), wondertrader released the latest version of v0.5.0, along with the latest version of wtpy, v0.5.0

Wondertrader has made the following changes in v0.5.0:

  • High frequency strategy engine officially released。 High frequency strategy engine beforeWonderTraderHowever, due to insufficient testing, it has not been officially released for the time being. It only focuses on CTA strategy combination. With the stock selection engine released by v0.4.0, v0.5.0 also officially released the high-frequency engine, thus achieving the goalWonderTraderFull coverage of different policy application scenarios.

    • CTA engineFor multi strategy combination. CTA engine adoptsSynchronous event drivenMode, which requires that the time of policy calculation should not be too long. For futures, according to the speed of a 500ms snapshot, the CTA strategy in Python generally triggers recalculation when the main K line is closed, and the single calculation time is generally within 10 milliseconds. That is to say, in the same strategy combination, in the interval between two ticks, excluding the time cost of the engine itself, it canSupport more than 40 policies running at the same time。 Generally speaking, this number is the main contract of all domestic futures. The purpose of CTA engine synchronous scheduling is toThe target position of consolidation strategy portfolio is net positionAnd then send it to the execution module to submit the instructionFundamentally eliminate self transactionIn addition, it can save Commission and margin and improve the efficiency of capital utilization. (the backtesting engine can calculate the average time consumption of each strategy in each calculationDualThrustFor example, it usually takes 4-6 MS) CTA engine also provides tick level response interface, which is mainly aimed at the risk control requirements of the strategy itself.
    • SEL engineIt is suitable for stock selection system or complex algorithm strategy. SEL engine adoptsAsynchronous time drivenMode, as long as between the two recalculation scheduling, the policy operation can be completed. Because the SEL engine is asynchronous, the signal cannot be integrated at the same time to send out (forced integration to the same time execution may lead to the loss of trading opportunities, resulting in unexpected risks of strategy). The advantage of sel engine is: supportTask scheduling above daily level(mainly for the demand of stock selection, the general stock selection strategy rotation time is relatively long), at the same timeMinute scheduling level support(mainly for the intraday filtering of the preset stock pool), the daily level task scheduling does not limit the time, whether the trading time can be executed, and the task scheduling at the minute level is limited to the trading time. The typical usage is to get the basic stock pool by selecting stocks at daily level after hours, and then set the stock selection of minute line level for the basic stock pool in the intraday.
    • HFT engineFor high frequency strategy. HFT engines are also usedSynchronous event drivenpattern. The difference between HFT engine and CTA engine is that CTA engine needs external execution module, while HFT engine has its own strategy. In short, it isThe HFT engine allows policies to operate directly on the transaction interface。 HFT engine has high requirements on policy, which requires policies to manage orders by themselves and handle overtime revocation. However, the HFT engine still provides a series of convenient interfaces for the strategy. For example, the HFT engine only provides three order orders, i.e. buy, sell and cancel orders. In the strategy logic, there is no need to pay attention to whether to buy or close positions. These will be automatically processed in the trading interface (the trading interface reads the opening strategy configuration fileactionpolicy.jsonThrough the configuration file, the priority and boundary parameters of opening, closing and closing for different varieties are configured.
  • Increase the processing logic of stock data weight recovery factor. in useWonderTraderWhen testing or trading stocks,WonderTraderIt will automatically read the data that has not been restored, as well as the weight recovery factor, and then carry out the pre restoration processing.
  • Transaction module adds transaction data landing. The main real-time landing data include: transaction details, order details, position data and fund data.
  • Other code detail adjustments

Wtpy has made the following changes in v0.5.0:

  • The synchronization layer is the latest version v0.5.0
  • Because of the need of high-frequency strategy development, the underlying directory structure of C + + has been readjusted (mainly the market access interface. Previously, data components were used separately, and now HFT strategy may also be used directly)
  • Added the correspondingHftContextModules, andBaseHftStrategymodular.

Plans for the next phase

up to now,WonderTraderBasically, the application scenarios have been fully covered, so the future development plan will change from the implementation of major functions to the

  • Wtpy will have a built-in servo engine based on flag, which is mainly used for remote monitoring
  • Wtpy will have a set of built-in Web UI as the resource of flash server for users to view remotely
  • Optimize the details of the underlying interface to make it easier to call application layers such as python
  • Test and improve the underlying core module