Question about P3 Squeeze indicator

Miket

Member
I found this in the thinkScript lounge. Anyone knows how this works?

Code:
# Combined Signal P3 Squeeze
# Mobius
# Chat Room 09.01.2020

# PPO
# Mobius
# V01.03.2014

declare lower;

input c = close;
input AvgType = AverageType.Simple;
input nFast = 8;
input nSlow = 13;
input nSmooth = 5;

def h = high;
def l = low;
plot PPO = ((MovingAverage(AverageType = AvgType, c, nFast) -
             MovingAverage(AverageType = AvgType, c, nSlow)) /
             MovingAverage(AverageType = AvgType, c, nSlow));
plot smooth = MovingAverage(AverageType = AvgType, PPO, nSmooth);
     PPO.AssignValueColor(if PPO > smooth
                          then Color.Green
                          else Color.Red);
     smooth.AssignValueColor(if PPO > smooth
                             then Color.Green
                             else Color.Red);
addCloud(PPO, smooth, Color.Green, Color.Red);
# Scale Algorithm
script Scale {
    input c = close;
    input data = close;
    def Min = lowestAll(data);
    def Max = highestAll(data);
    def hh = HighestAll(c);
    def ll = LowestAll(c);
    plot Range = (((Max - Min) * (c - ll)) /  (hh - ll)) + Min;
}
# Scaled DMI+ DMI-
input length = 14;
input averageType = AverageType.WILDERS;

def hiDiff = h - h[1];
def loDiff = l[1] - l;
def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
def minusDM =  if loDiff > hiDiff and loDiff > 0 then loDiff else 0;
def ATR = MovingAverage(averageType, TrueRange(h, c, l), length);
def Di_plus =  MovingAverage(averageType, plusDM, length) / ATR;
def Di_minus =  MovingAverage(averageType, minusDM, length) / ATR;
plot DIplus = Scale(c = Di_plus, data = PPO);
plot DIminus = Scale(c = Di_minus, data = PPO);
     DIplus.SetDefaultColor(Color.Cyan);
     DIminus.SetDefaultColor(Color.Yellow);
addCloud(DIplus, DIminus, Color.Cyan, Color.Yellow);
# End Code # Combined Signal P3 Squeeze
 

BenTen

Administrative
Staff member
Staff
VIP
11:05 FrankB3: Stock:::: althought I never test any thing, just watch alot. To me looks like it predicts turnning points 85% - 90% of the time. What I think is important is the concept. So over the years I have used, and still a work in progress, have developled many different P3 squeezes, only with the help of the good folks in here. There is about 50 some seminars on u-tube about P3 Squeeze,,,
 

Similar threads

Top