The problem of logical consistency between backtesting and live trading

In a complete quantitative workflow, after locking the strategy, such as pair trading,

it is best to use the event driven backtest framework to implement backtesting, and then use the same strategy code to implement real trading in the same framework to ensure 100% consistency in the logic of backtesting and real trading.



Logical consistency is also a prerequisite for large-scale and rapid verification strategies



The question is: how to achieve the above logical consistency effect? ​​

What directions can be used to connect Binance Perpetual Contract in real trading?



Direction A

Research Quantopian, QuantConnect, Ninjatrader, MarketCetera, AlgoTrader, OpenQuant

BTW,

I have tried QuantConnect, which is expensive with a minimum of $70+/Mo and does not support perpetual contracts for digital currencies.

I have also investigated Blueshift, which currently does not support digital currencies.



Direction B

Build a backtesting and live trading integrated framework by DIY, and I can implement real trading by modifying the configuration file. Similar to what Roger, CTO of QTS Capital Management LLC, did.

Follow up question: Has anyone done similar projects? How many resources are required? e.g. Software Engineer, Unit: per person/day;

 

Hi Rong, 

As you have noted correctly, there may be limitations on using perpetual contracts for the platforms you listed. The solution is to create your own framework, which can ensure total control and logical consistency. 



To achieve logical consistency between backtesting and live trading, it's essential to modularize the strategy logic for reuse across both environments. An event-driven architecture should handle ticks, order execution, and position management uniformly.

For backtesting, make sure you have historical data of Binance perpetual contracts, allowing seamless testing without altering the live trading code. A unified interface using API wrappers should be implemented to place and manage orders in both modes. Finally, ensure the framework allows easy switching between backtest and live modes via configuration settings. 



The exact resources will depend on the scope of the project and specific performance or scaling requirements. The skills required would be coding, managing infrastructure and maintaining database.