NexusFi: Find Your Edge


Home Menu

 





SPY blocks with price and colors


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,038 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

SPY blocks with price and colors

  #1 (permalink)
alagrande
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

Reply With Quote




Last Updated on June 4, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts