Drawing horizontal line sections

 
Can some one provide me a sample code (or guidance) with which i can draw horizontal lines on set of bars. For example for each set of 10 bars I want lower and higher values enveloped by horizontal lies. In case of uptrend, the result will be kind of stairs patters each with width of 10 bars. I have seen such plots but can not find out where. Can some one help me.

Thanks,
Krana
Reason: