//144 was one of WD Gann's favourite time counts. This finds 142 trading days from any pivot to give a couple of days warning. Charts must be bars only, no filters for Cal days or holidays etc;
//Set Pivot Label value (the higher the value, the more significant);
$Pivot=30;
//Set Timecount required ie 142 days;
$TC=142;
//Get Pivot signals (high ==1, low == -1);
Piv1=PIVOT(MIN=$Pivot, DIR=Both, TYPE=Both, IGNOREUNCONFIRMED=True) <> 0;
//Use the Offset function to signal when the pivot occurred $TC bars ago;
OFFSET(Piv1, OFFSET=$TC)