chantomkit

Can I use the getHistoricalBar only for live testing

Programming


Hello, I want to ask about the function of getHistoricalBar.

For example in backtesting, I want to get the historical 2min bar data of certain instrument and calculate some indicators. I can use this function to return a dictionary and convert it into dataframe for further computation.

But then in livetesting, does this function still work in real time? like it can still return the previous N bars of data from current time?

If this does not work, then I will need to get and accumulate the streaming tick data and build my own dataframe every certain period.
 
admin
Hi chantomkit, all the API functions used for backtest will behave the same in the live environment. 
In fact, once you are satified with a backtest result, the backtest script can be deployed to paper or real-trading environment without any code amendment. This article discusses the steps for live deployment.