Backtesting Live Ticks Possible?
-
Hi,
using
ibtest.py --data0 EUR.USD-CASH-IDEALPRO --timeframe Seconds --compression 30 --port 7497 --replay
seems to be the best way to- have live tick data
- to get properly shaped live data candlesticks for candlestick periods that lie in the past (even without backfilling the data that came up before the script was started).
(see: https://community.backtrader.com/topic/998/best-approach-for-live-trading-with-cheat-on-open/12# )
My question is: during pure backtesting: is it possible to get the data in
next()
the same way as I get it during live trading?(so like this mix out of well shaped candlesticks and arbitrarily occuring "live" ticks)
Thanks in advance!
-
@newesttrader said in Backtesting Live Ticks Possible?:
My question is: during pure backtesting: is it possible to get the data in next() the same way as I get it during live trading?
Of course. Create a data feed which has that behavior and you will get it.
-
@backtrader said in Backtesting Live Ticks Possible?:
Of course. Create a data feed which has that behavior and you will get it.
thanks for your reply, @backtrader , but I just wonder how I can do that?
With every row in my csv file,
len(self)
innext()
will increase by one from one call tonext()
to the following call.In contrast to that, during live trading
len(self)
only increases, when the next timeframe is reached. But in between, several ticks could have come up that do not lead to an increase inlen(self)
.Big thanks in advance!
-
If you have ticks in your data feed and you
replay
it to a larger timeframe, you will get that behavior too. But you need to have ticks stored, which is not the most usual setup.