A donor asked if I had some code for Range bars for Think Desktop. Range bars are bars that complete after a certain range has been traveled, and then a new bar starts at the next tick. Unfortunately, ToS doesn’t let us create custom bar types. But that doesn’t stop us from trying to hack together a workaround!
The “solution” I came up with is not a true range bar according to the traditional definition. The simple indicator I made starts with the first bar open. The indicator then checks for if we have moved X points from the open in either the high or low direction. Once we have moved the required amount one way or the other, we plot a new open level. I also keep track of the value of the open of the prior “Range bar”, and if the new “Range bar” open is a downtick, we get a red cloud. Opposite for upticks. This indicator is designed to use the fastest data available, which for now is a 133 tick chart. Here’s what the indicator looked like on ES today with a +/- 1 point range setting:
On my first examination, it seems more useful as a trend direction indicator than a true proxy for range bars. You could sell a pullback into a red zone, or buy a pullback into a green zone, for example. But it’s the best I can do with what we have available in thinkscript right now (as well as with my time schedule X_X).
This one is available to blog donors on my Google site (look for “Range_Bar_IndicatorSTUDY.zip” in the “Donors Only” folder). For the do-it-yourself types, leave a comment if you have questions and want to build your own, or have any other thoughts.

