So I took the zigzag pivot of my last script , i remove the original zigzag and replace it by % zigzag , then i add the TP % 1 and 2 and by the cross of the uptrend of the zigzag % of the pivot points of support and resistance we can make buy and sell signal (H and L) and take the profit out by the trend using the Take profit 1 and 2.
for each time frame you need to set up the % correctly for the best fit to get optimal results
set also the bar length or resistance to best fit (now its on 20) try maybe 10 or 15