glendale ca usa
Posts: 97 since Sep 2017
Thanks Given: 11
Thanks Received: 88
|
# Rigel, May 2018
#
declare lower;
#input Sym2 = "RUT";
input Sym2 = "SPY";
def c2 = close(symbol = Sym2);
def ma3=average(c2,3);
def ma35=average(c2,15);
addlabel( yes, "SPY", if c2>c2[1] then color.green else color.red);
#plot Dots = (HighestAll(high(symbol = Sym2)) + LowestAll(low(symbol = Sym2))) / 2;
#Dots.SetStyle(Curve.POINTS);
#Dots.SetLineWeight(5);
#dots.setDefaultColor(color.gray);
#Dots.AssignValueColor(if ma3 > ma35[1] then Color.GREEN else if ma3 < ma35[1] then Color.RED ELSE COLOR.GRAY);
AddLabel (yes, ((" ")), if ma3 > ma35 then color.cyan else if ma3 < ma35 then color.magenta else color.gray);
#METER_FUERZA
#declare lower;
input length = 3;#14
input ShowADXValue = {DoNotShow, OnLeft, default OnRight};
input DisplayStrengthMeter = {"No", default "Yes"};
input FixedValueBkgndColor = {default "No", "Yes"};
#def c2 = close(symbol = Sym2);
input lengthF = 13;#13
DEF FI = ExpAverage(data = (close(symbol = Sym2) - close(symbol = Sym2)[1]) * volume(symbol = Sym2), lengthF);
def ADX = DMI(length).ADX;
def DIBull = DIPlus(length);
def DIBear = DIMinus(length);
def BullishTrend = DIBull >= DIBear;
def ShowDigits;
switch (ShowADXValue)
{
case DoNotShow:
ShowDigits = 0;
case OnLeft:
ShowDigits = 1;
case OnRight:
ShowDigits = 2;
}
#if DI+ > DI- then trend is bullish
#if DI- > DI+ then trend is bearish
#if ADI >= 20 then market is trending
def HighlightColor =
if (FI >= 50) then 51 else
if (fi >= 40 and fi < 50) then 51 else
if (fi >= 30 and fi < 40) then 102 else
if (fi >= 20 and fi < 30) then 153 else
if (fi >= 10 and fi < 20) then 204 else
255;
AddLabel(!FixedValueBkgndColor and ShowDigits == 2, round(c2), CreateColor(if !BullishTrend then 255 else HighlightColor, if !BullishTrend then HighlightColor else 255 , 141));
#AddLabel (yes, "SPY", Color.WHITE);
#END CODE
|