Range bars in backtesting
Range bars in backtesting
06 Jun 2022, 14:22
Hi!
I'm backtesting my strategy, but i use range bars and i see that range bar is not provided for backtesting.
Are you planning to provide range bars for backtesting?
Thanks!!
Replies
baolinhhk9
26 Nov 2022, 18:33
We are now can backtest on heiken ashi chart (not optimize) but range chart is not. I need it a lot.
@baolinhhk9
scotpip
29 Nov 2022, 18:15
RE:
I have the same requirement.
I've given up on waiting for Spotware to implement this - it's many years overdue now. It will hopefully appear now they have completed their .Net upgrade, but I can't wait any longer.
So I think that the only solution is to backtest with ticks and create your own range bars. It's a simple bar so this is relatively trivial,
Tick resolution backtesting is slow, but has the advantage of accuracy.
Then you have the problem of visualising your bars, indicators and trades. I'm researching this right now.
I don't think you can create a new chart directly in the CTrader API like to can with MT4 or JForex - though I'm going to post a question to double-check this.
So the main options are to export to a JS or Python charting library. This will be tedious but not particularly difficult. The main issue is deciding which library to use.
For example Highstock has a C# wrapper, though it's pretty limited from what I can see.
For Python you might want to check out Mplfinance: https://medium.com/codex/creating-advanced-financial-charts-with-python-in-one-line-of-code-79f87ed482e8
Python may be the easiest way to go, because there are wrappers that enable you to call Python code directly.
Once I've got something up and running, I'll try to share it with the community.
@scotpip
amusleh
07 Jun 2022, 09:18
Hi,
It's on our plan to add back testing for range, Renko, and tick charts, we can't give you any ETA now.
@amusleh