Feature question - importing price-based bars for backtesting

Posted By: scotpip

Feature question - importing price-based bars for backtesting - 10/05/20 14:27

Hi

Before I invest the time in learning Zorro, I'd appreciate knowing if it can handle one of my key requirements.

I'd want to import price-based bars (renko and range) from CSV files. These can be in any format convenient to Zorro.

Can this be done at all - ideally in the free version but otherwise in the sponsored version?

In the free version, what would happen if there was more than one bar per minute on occasion, for example in a newsy market?

If I understand right, I could definitely do this in the sponsored version with the user-defined bars feature using tick data. I would do this for live trading but this would be very slow for backtesting, especially for optimisation runs. So importing ready-formed bars would be a much better solution.

Also, can this type of bar (imported and/or user-defined) access the full feature range in Zorro, or are there any practical restrictions?

Thanks folks!
Posted By: danatrader

Re: Feature question - importing price-based bars for backtesting - 10/05/20 18:06

Well you can use your own history data.
For free version the bars need to be in t6 format I think.
So a bar needs to be longer than 1 min.

Full version allows you to import tick data.

So you could already manipulate your open high low close to resemble the bars you need (for backtesting).
Posted By: jcl

Re: Feature question - importing price-based bars for backtesting - 10/06/20 08:46

Zorro won't care if imported bars are time based, price based, or magic based. But you should then also have an additional minute or tick based price history for a realistic backtes. Brokers won't fill your trades at Renko boundaries.
Posted By: scotpip

Re: Feature question - importing price-based bars for backtesting - 10/06/20 15:23

Originally Posted by jcl
You should then also have an additional minute or tick based price history for a realistic backtest. Brokers won't fill your trades at Renko boundaries.


Thanks for the response, but I'm confused by your suggestion that brokers won't fill a trade at a Renko boundary. Provided there is volume in the bar, how is it any different from the boundary of a minute bar?

Both are abstract buckets for a stream of ticks. I can't see how an arbitrary time boundary is any different from an arbitrary price boundary in terms of getting filled.

Obviously if the Renko bar is in the middle of a gap and has no volume, you'll see slippage. But that is trivial to allow for - you simply skip the bar and don't run your exit rules against it. A time-based bar could also close in the middle of a gap, though admittedly this is less likely.

In the end, it's obviously a good idea to do a final check at tick resolution, but that is slow, even in Zorro. For fast iteration of ideas we have found Renko bars as reliable as anything else on our previous platform.

If a strategy is so marginal that small inaccuracies in slippage are critical, it's probably not tradeable anyway. You could say that of any bar type, given that we can't rely on 100% data quality.
© 2023 lite-C Forums