Tick Charts or Constant Range Bars

 
Would it be possible to write some type of indicator that plots constant tick charts or constant range bars in another window? These are different forms of charting that are not time based. For example, a 100 tick bar is formed whenever price moves 100 ticks. So on little volume, no bar is formed. A constant range bar is formed whenever price moves a set number of ticks in a range. For example, a range bar set at 20 forms whenever price fills a 20 pip range. Then the next bar is started. Since these aren't time based, I'm not sure if it would be possible in this platform.
 
It is possible with MQL4. Try to refer to community at https://www.mql5.com/en/forum
 
how is this possible?
Reason: