glendale ca usa
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88
|
#ADX_CLOUD
# DI, ADX, and Trend Indicator (updated 12/18/13)
declare lower;
INPUT ATRLENGTH = 25;
input DI_length2 = 3;
input DI_length = 8;
input DI_length3 = 63;
input ADX_length = 25;
input Strong_Trend = 25;
input DisplayStrengthMeter = {"No", default "Yes"};
#addlabel (yes, "adx", color.CYAN);
INPUT PRICE = CLOSE;
plot MiddleLine = 20;
MiddleLine.SetStyle(Curve.LONG_DASH);
MiddleLine.setLineWeight(2);
MiddleLine.setDefaultColor(color.gray);
def DX = if (diplus ( di_length) + diminus(di_length) > 0) then 100 * AbsValue(diplus(di_length) - diminus(di_length)) / (diplus(di_length) + diminus(di_length)) else 0;
PLOT "DI+" = DIPlus(DI_length);
"DI+".SetDefaultColor(Color.white);
"DI+".SetLineWeight(1);
PLOT "DI3+" = .8* DIPlus(DI_length3);
"DI3+".SetDefaultColor(Color.white);
#plot "DI-2" = DIMinus(DI_length + DI_length2)/2;
plot "DI-" = DIMinus(DI_length);
"DI-".SetDefaultColor(Color.gray);
"DI-".SetLineWeight(1);
ADDcloud("DI-", "DI+", color.red, color.green);
AddLabel ("di+" > "di+"[1] and "di-" < "di-"[1], " 1 ", (color.green));
#AddLabel( "di+" > "di+"[1], " 1 ", (color.green));
AddLabel( "di-" > "di-"[1] AND "di+" < "di+"[1], " 1 ", (color.red));
######################
input lengthR = 14;
input over_Bought = 70;
input over_Sold = 30;
#input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;
def NetChgAvg = MovingAverage(averageType, price - price[1], lengthR);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), lengthR);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
DEF RSI = 50 * (ChgRatio + 1);
AddLabel(yes, " RSI(M)" +Round(RSI, 1) , if RSI > 52 then color.light_green else if RSI < 48 then color.dark_red else color.gray);
########
middleLine.AssignValueColor(if RSI > 52 then COLOR.CYAN else if RSI<48 then color.PINK else Color.gray);
########
input lengthF = 13;
def FI = ExpAverage(data = (close - close[1]) * volume, lengthF);
AddLabel(yes, " FI(M)" +Round(FI, 1) , if FI > 0 then color.light_green else if FI < 0 then color.dark_red else color.gray);
##AddLabel(yes, " FI(M)" +Round(FI, 1) , if FI > 0 then color.light_green else if FI < 0 then color.dark_red else color.gray);
#def RsiDecreaseBars = if RsiDecrease then RsiIncreaseBars[1] + 1 else 0;
#FISHER to add color to ADX LINE-------------
input priceft = hl2;
input lengthft = 10;
def maxHigh = Highest(price, lengthft);
def minLow = Lowest(price, lengthft);
def range = maxHigh - minLow;
def value = if IsNaN(price)
then Double.NaN
else if IsNaN(range)
then value[1]
else if range == 0
then 0
else 0.66 * ((price - minLow) / range - 0.5) + 0.67 * value[1];
def truncValue = if value > 0.99 then 0.999 else if value < -0.99 then -0.999 else value;
def fish = 0.5 * (log((1 + truncValue) / (1 - truncValue)) + fish[1]);
def FTOneBarBack = fish[1];
plot FT = fish;
FT.hide();
##
#-------------------------------------------
plot ADX = Average ( DX, adx_length);
ADX.DefineColor("Stronger", Color.CYAN);
ADX.DefineColor("Weaker", Color.PINK);
ADX.AssignValueColor(if ft > 0 and adx>20 then ADX.Color("Stronger" ) else if ft < 0 and adx>20 then color.pink else Color.gray);
ADX.SetPaintingStrategy(PaintingStrategy.LINE);
ADX.setLineWeight(2);
ADX.SetStyle(CurvE.MEDIUM_DASH);
#plot Line20 = 20;
#Line20.SetStyle(Curve.LONG_DASH);
AddCloud(adx, 20, ADX.Color("stronger" ));
def weaker = if ft < 0 then ADX else Double.NaN;
AddCloud(weaker, 20, ADX.Color("weaker" ));
#################
###
AddLabel (yes, ((" 1 ")), if FI>200 then CreateColor(0, 0, 255) else if FI<-200 then CreateColor(255, 255, 0) else Color.LIGHT_GRAY);
#
AddLabel (yes, ((" 2 ")), if FI>2000 then CreateColor(0, 85, 255) else if FI<-2000 then CreateColor(255, 213, 0) else Color.LIGHT_GRAY);
#
AddLabel (yes, ((" 4 ")), if FI>4000 then CreateColor(0, 128, 255) else if FI<-4000 then CreateColor(255, 170, 0) else Color.LIGHT_GRAY);
#
AddLabel (yes, ((" 6 ")), if FI>6000 then CreateColor(0, 170, 255) else if FI<-6000 then CreateColor(255, 128, 0) else Color.LIGHT_GRAY);
#
AddLabel (yes, ((" 8 ")), if FI>8000 then CreateColor(0, 213, 255) else if FI<-8000 then CreateColor(255, 85, 0) else Color.LIGHT_GRAY);
#
AddLabel (yes, ((" 10 ")), if FI>10000 then CreateColor(0, 255, 255) else if FI<-10000 then CreateColor(255, 0, 0) else Color.LIGHT_GRAY);
#######
|