'Draw right extended line on "High and Low bar" of pivot High candle

I want to draw a line , extended right, on the Low of the pivot high candle and at High of the pivotlow, as applicable in the running market, can anyone suggest a little code which does that? . we should also delete history to make the chart clear. I am new in pine script



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source