Custom SQX Non-Time Based Bars

I know this won't be addressed for a while but I think it is important to list this in the log for when it eventually implemented. The reason other bar types are important are because they will provide completely different entry points for strategies than minute charts can, allowing for many more strategies that can be found which would otherwise are undiscoverable on minute chart data. SQX may have a tough time finding strategies on a 1hr chart but may find many more strategies on the same instrument using a range/renko/etc chart due to the handling of the noise depending on bar size. Less noise can mean better and higher quality strategies. While this will not be the case all the time, it is definitely worth it for the times that these bar types may provide an edge. I wanted to list a proper way of how to approach designing these bars after dealing with the pitfalls of trading non time based bars for years. Mark has stated that SQX will need custom bar types for anything outside of time based bars (Minute/daily candlesticks) so I expect it to take a lot of time to develop these from scratch. Here's a basic guideline I believe should be followed in order to get it right the first time.



Eventually when this is implemented, we need the following:


Full control over the entire bar size, which would be the wick and the brick sizing. For wick sizing we should be able to determine either a specific unit size, i.e. an (up to) 8 tick wick size for a 12 tick brick bar, or a ratio for the brick size, i.e. 2:1 to the brick size of a 5 tick brick would render a wick of (up to) a 10 tick wick extending from a 5 tick brick. When the wick size has been exceeded, a bar will paint in the opposite direction at a gapless close. Specifying wick/brick sizing can't be done on volume/tick/pnf based bars as they do not depend on bar sizing in order to form a new bar. More on this below. 


Most bars should, by default, have no gap between the close of the previous bar and the open of the following bar. See screenshot of gapless renkos:
https://screencast.com/t/NwtUCYP1



The reason you need to have gapless bars is because anything otherwise will create a false open and distort all backtest results. This is a common issue renko traders have that develop algorithms for these types of bars.
The following is an example of what NOT to do:
https://screencast.com/t/1q9ZAom24



We also need gapless range bars. See example screenshot: 
https://screencast.com/t/EEwKsSW71



Gapless tick charts look very similar to minute charts except they only form a new bar when x number of ticks has occurred within the bar. See screenshot:
https://screencast.com/t/QIvDEtJKG

Gapless volume charts would look the same as gapless tick charts except they would rely on the total volume that has occurred within the bar and would form a new bar when x volume has occurred.


The only bars that should not have a gap are point and figure bars, which are designed to have a gap between the close between the previous bar and the open of the proceeding bar. This is because point and figure bars rely on forming after a specified retracement from the high/low of the bar has occurred. Because of the way these bars are calculated, the proceeding open levels are not "false opens" as they are in other bars such as renkos with gaps in them. See screenshot:
https://screencast.com/t/zKj5kWWk9



The last addition to these bar types that we need would be volatility-adaptable ATR renko/range/pnf bars. These bars all rely on the user specifying a bar size in order to determine the bar size for the entire chart. But it is also beneficial to create bars that adapt to volatility. For tick and volume bars, instead of using ATR to determine size, we can use a rolling average of tick/volume (respectively) for an x-minute bar over x period where x is user definable. A task outlining how to do this has been created here: https://roadmap.strategyquant.com/tasks/sq4_5230


The last thing we would need with these bars are using all available resolutions for testing purposes. Simply making renko charts with a gap will destroy all backtest results. The slightest thing can mess up testing for these type of bars so it is important that we can test these with the highest fidelity possible. Tick is ideal for resolution, however we all know how slow testing at tick resolution can be for generation. These type of bars may benefit from generating at 1 second resolution as described here: https://roadmap.strategyquant.com/tasks/sq4_1551 and then retesting on tick data. 

Attachments
No attachments
  • Votes +2
  • Project StrategyQuant X
  • Type Feature
  • Status Archived
  • Priority Normal
  • Assignee None

History

KL
#1

kainc301

06.10.2019 19:20

Task created

KL
#2

kainc301

06.10.2019 20:42
Voted for this task.
t
#3

todtv

03.12.2019 14:18
Voted for this task.
t
#4

todtv

03.12.2019 14:21
I am supporting to have choose set of range bar graphs in SQX. During My by hand commodity trading in Interactive Brokers platform with Sierrachart visualization I was more successful on lower time frame with range bar graph then with time based graph.
KL
#5

kainc301

03.12.2019 14:46
In my opinion, non time based bars beat out time based bars because they filter out different variations of noise, making it much more likely for indicators to reduce false signals. I think it would have a substantial impact on building strategies.
h
#6

hankeys

04.12.2019 06:57
i dont think so, that those kind of bars are filtering something for us - OK i can understand that anyone could see some noise filtering in them meaning of time - but truly you will get only different kind of noise, nothing more - all those bars will be  choppy too


second bigger problem is how to trade those kind of bars - for now if you want to trade different type of bars, you need to open separate offline graph for each strategy - if i want to trade portfolio of 20 strategies, i will need 20+20 open charts. 


we were trying renko bars with SQ3 and i can tell only one thing - its not tradable - offline graphs are slow, the bars do not redraw fast enough, etc. etc.

KL
#7

kainc301

04.12.2019 07:05
There will always be noise in any time series data. Thats inevitable. But because of the way they are made, by definition they filter out a degree (depends on settings) of noise generated by time based bars by normalizing the OHLC.


As for multiple charts, the offline charts do not rely on the original chart in order to run. It should only rely on connection feed. So you should be able to close the original chart after making the offline version and essentially keep the same amount of charts to run the ea's on. Ideally we could use an ea manager to manage all of this in the background. 


Renkos were not optimized for SQ3 and were not built with using real data resolution. The proposal is to create bars optimized for learning with SQX. It is definitely tradable if done correctly, parts of which are addressed in this thread such as making sure these bars were gapless. 

MF
#8

Mark Fric

26.10.2020 11:01

Status changed from New to Archived


Votes: +2

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please