glendale ca usa
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88
|
declare lower;
#ASIN_CLOUDS_v2
#ASIN_MESA
input length = 8;
input over_Sold = 5;
input over_Bought = 80;
plot zerobase = 5;
zerobase.setStyle(curve.MEDIUM_DASH);
zerobase.setDefaultColor(color.white);
plot nine = -6;
nine.setDefaultColor(color.white);
nine.setStyle(curve.MEDIUM_DASH);
def highest = Highest(high, length);
def divisor =highest - Lowest(LOW, length);
plot W =- if divisor equals 0 then 0 else 100 - 100 * (highest - close) / divisor;
#plot OverBought = over_Bought;
#plot OverSold = over_Sold;
w.hide();
#Asin
input length0 = 24;
def height = close - close[length0];
def hypotenuse = Sqrt( Sqr(length0) + Sqr(height) );
#plot Angle2 = ASin(height2/hypotenuse2) * 180 / Double.Pi;
#plot Angle2 = ASin(W/hypotenuse) * 180 / Double.Pi;
plot Angle3 = - COS(W/hypotenuse) * 90 / Double.Pi;
Angle3.setDefaultColor(color.red);
#Asin
input length2 = 74;
def height2 = close - close[length2];
def hypotenuse2 = Sqrt( Sqr(length2) + Sqr(height2) );
plot Angle2 = ASin(angle3/hypotenuse2) * 100 / Double.Pi;
Angle2.setDefaultColor(color.green);
#Asin
input length1 = -8;
def height1 = close - close[length1];
def hypotenuse1 = log( Sqr(length1) + Sqr(height1) );
plot Angle1 = sqrt(height1/hypotenuse1) * 0 / Double.Pi;
Angle1.setDefaultColor(color.red);
Angle1.setLineWeight(3);
input lengthA = 8;
def heightA = close - close[lengthA];
def hypotenuseA = log( Sqr(lengthA) + Sqr(heightA) );
plot AngleA = sqrt(hypotenuseA/heightA) * 0 / Double.Pi;
AngleA.setDefaultColor(color.green);
AngleA.setLineWeight(5);
anglea.hide();
plot AA = (anglea==anglea);
AA.setDefaultColor(color.green);
AA.setLineWeight(5);
#
addcloud(angle3, angle2, color.green, color.red);
addcloud(angle3, angle2, color.green, color.red);
#
plot UpSignal = if angle3[2]>23 and angle3<-25 and angle1==angle1 then 0 else Double.NaN;
upsignal.setLineWeight(5);
#plot DownSignal = if RSI crosses below OverBought then OverBought else Double.NaN;
UpSignal.SetPaintingStrategy(PaintingStrategy.points);
upSignal.SetDefaultColor(Color.white);
#DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
input price = hl2;
input lengthM = 25;
def realPart = fold indexR = 0 to lengthM with accuR = 0 do accuR + getValue(price, indexR, lengthM - 1) * Cos(2 * Double.Pi * indexR / lengthM);
def imagPart = fold indexI = 0 to lengthM with accuI = 0 do accuI + getValue(price, indexI, lengthM - 1) * Sin(2 * Double.Pi * indexI / lengthM);
def phase1 = if AbsValue(realPart) > 0.001 then ATan(imagPart / realPart) else (Double.Pi / 2 * Sign(imagPart));
def phase2 = if realPart < 0 then phase1 + Double.Pi else phase1;
def phase = if phase2 < 0 then phase2 + 2 * Double.Pi else if phase2 > 2 * Double.Pi then phase2 - 2 * Double.Pi else phase2;
|