DOW 30 - Market Breadth
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//Script Date 8/8/2022 : Script Version 1
// © maplehunger123

//Script Analalises All stocks within the DOW JONES INDUSTRIAL ADVERAGE as 8/9/2022, evaluating VWap, and EMA bands suggesting Overall intra-day Market Trends. 
//This indicator main usage is for intraday analysis understanding current market centiment being bearish, or bullish.
//Current stocks: 3M, American Express, Amgen, Apple, Boeing, Caterpillar, Chevron, Cisco Systems, Coca-Cola, Disney, Dow, Goldman Sachs, Home Depot, Honeywell, IBM, Intel, Johnson & Johnson, JP Morgan Chase, McDonald’s, Merck, Microsoft, Nike, Procter & Gamble, Salesforce, Travelers, UnitedHealth, Visa, Walgreens, and Walmart.
//THIS INDICATOR IS WEIGHTED BY DJI.
//@version=5
indicator("DOW 30 - Weight", overlay=false)

// OPTIONS OF SHORT TERM TIMEFRAME ------------------------------------------------------------------------Option TO BE ADDED----------------------------------------------------
//SHORT_TERM =  -------------------------------------------------------------------------------------------Option To Be ADDED ---------------------------------------------------
// OPTIONS OF LONGER TERM TIMEFRAME -----------------------------------------------------------------------Option To Be ADDED ---------------------------------------------------
//LONGE_TERM = --------------------------------------------------------------------------------------------Option To Be ADDED ---------------------------------------------------


// 9 EMA REQUEST
// 20 EMA REQUEST
// Vwap Request
// Stock Price Request

AXPema9     = ta.ema(request.security("AXP", "1", close), 9) 
AXPema      = ta.ema(request.security("AXP", "1", close), 20) 
AXPVwap     = ta.vwap(request.security("AXP", "1", close)) 
AXP         = (request.security("AXP", "1", close)) 

AMGNema9 = ta.ema(request.security("AMGN", "1", close), 9)
AMGNema = ta.ema(request.security("AMGN", "1", close), 20)
AMGNVwap = ta.vwap(request.security("AMGN", "1", close)) 
AMGN = (request.security("AMGN", "1", close))

AAPLema9 = ta.ema(request.security("AAPL", "1", close), 9)
AAPLema = ta.ema(request.security("AAPL", "1", close), 20)
AAPLVwap = ta.vwap(request.security("AAPL", "1", close)) 
AAPL = (request.security("AAPL", "1", close))

BAema9 = ta.ema(request.security("BA", "1", close), 9)
BAema = ta.ema(request.security("BA", "1", close), 20) 
BAVwap = ta.vwap(request.security("BA", "1", close)) 
BA = (request.security("BA", "1", close)) 

CATema9 = ta.ema(request.security("CAT", "1", close), 9)
CATema = ta.ema(request.security("CAT", "1", close), 20)
CATVwap = ta.vwap(request.security("CAT", "1", close))
CAT = (request.security("CAT", "1", close))

CSCOema9 = ta.ema(request.security("CSCO", "1", close), 9)
CSCOema = ta.ema(request.security("CSCO", "1", close), 20)
CSCOVwap = ta.vwap(request.security("CSCO", "1", close))
CSCO = (request.security("CSCO", "1", close))

CVXema9 = ta.ema(request.security("CVX", "1", close), 9)
CVXema = ta.ema(request.security("CVX", "1", close), 20)
CVXVwap = ta.vwap(request.security("CVX", "1", close))
CVX = (request.security("CVX", "1", close))

GSema9 = ta.ema(request.security("GS", "1", close), 9)
GSema = ta.ema(request.security("GS", "1", close), 20)
GSWap = ta.vwap(request.security("GS", "1", close))
GS = (request.security("GS", "1", close))

HDema9 = ta.ema(request.security("HD", "1", close), 9)
HDema = ta.ema(request.security("HD", "1", close), 20)
HDVWap = ta.vwap(request.security("HD", "1", close))
HD = (request.security("HD", "1", close))

HONema9 = ta.ema(request.security("HON", "1", close), 9)
HONema = ta.ema(request.security("HON", "1", close), 20)
HONVWap = ta.vwap(request.security("HON", "1", close))
HON = (request.security("HON", "1", close))

IBMema9 = ta.ema(request.security("IBM", "1", close), 9)
IBMema = ta.ema(request.security("IBM", "1", close), 20)
IBMVWap = ta.vwap(request.security("IBM", "1", close))
IBM = (request.security("IBM", "1", close))

INTCema9 = ta.ema(request.security("INTC", "1", close), 9)
INTCema = ta.ema(request.security("INTC", "1", close), 20)
INTCVWap = ta.vwap(request.security("INTC", "1", close))
INTC = (request.security("INTC", "1", close))

JNJema9 = ta.ema(request.security("JNJ", "1", close), 9)
JNJema = ta.ema(request.security("JNJ", "1", close), 20)
JNJVWap = ta.vwap(request.security("JNJ", "1", close))
JNJ = (request.security("JNJ", "1", close))

KOema9 = ta.ema(request.security("KO", "1", close), 9)
KOema = ta.ema(request.security("KO", "1", close), 20)
KOVWap = ta.vwap(request.security("KO", "1", close))
KO = (request.security("KO", "1", close))

JPMema9 = ta.ema(request.security("JPM", "1", close), 9)
JPMema = ta.ema(request.security("JPM", "1", close), 20)
JPMVWap = ta.vwap(request.security("JPM", "1", close))
JPM = (request.security("JPM", "1", close))

MMMema9 = ta.ema(request.security("MMM", "1", close), 9)
MMMema = ta.ema(request.security("MMM", "1", close), 20)
MMMVWap = ta.vwap(request.security("MMM", "1", close))
MMM = (request.security("MMM", "1", close))

MRKema9 = ta.ema(request.security("MRK", "1", close), 9)
MRKema = ta.ema(request.security("MRK", "1", close), 20)
MRKVWap = ta.vwap(request.security("MRK", "1", close))
MRK = (request.security("MRK", "1", close))

MSFTema9 = ta.ema(request.security("MSFT", "1", close), 9)
MSFTema = ta.ema(request.security("MSFT", "1", close), 20)
MSFTVWap = ta.vwap(request.security("MSFT", "1", close))
MSFT = (request.security("MSFT", "1", close))

NKEema9 = ta.ema(request.security("MSFT", "1", close), 9)
NKEema = ta.ema(request.security("MSFT", "1", close), 20)
NKEVWap = ta.vwap(request.security("MSFT", "1", close))
NKE = (request.security("MSFT", "1", close))

PGema9 = ta.ema(request.security("MSFT", "1", close), 9)
PGema = ta.ema(request.security("MSFT", "1", close), 20)
PGVWap = ta.vwap(request.security("MSFT", "1", close))
PG = (request.security("MSFT", "1", close))

TRVema9 = ta.ema(request.security("TRV", "1", close), 9)
TRVema = ta.ema(request.security("TRV", "1", close), 20)
TRVVWap = ta.vwap(request.security("TRV", "1", close))
TRV = (request.security("TRV", "1", close))

UNHema9 = ta.ema(request.security("UNH", "1", close), 9)
UNHema = ta.ema(request.security("UNH", "1", close), 20)
UNHVWap = ta.vwap(request.security("UNH", "1", close))
UNH = (request.security("UNH", "1", close))

CRMema9 = ta.ema(request.security("CRM", "1", close), 9)
CRMema = ta.ema(request.security("CRM", "1", close), 20)
CRMVWap = ta.vwap(request.security("CRM", "1", close))
CRM = (request.security("CRM", "1", close))

VZema9 = ta.ema(request.security("VZ", "1", close), 9)
VZema = ta.ema(request.security("VZ", "1", close), 20)
VZVWap = ta.vwap(request.security("VZ", "1", close))
VZ = (request.security("VZ", "1", close))

Vema9 = ta.ema(request.security("V", "1", close), 9)
Vema = ta.ema(request.security("V", "1", close), 20)
VVWap = ta.vwap(request.security("V", "1", close))
V = (request.security("V", "1", close))

WBAema9 = ta.ema(request.security("WBA", "1", close), 9)
WBAema = ta.ema(request.security("WBA", "1", close), 20)
WBAVWap = ta.vwap(request.security("WBA", "1", close))
WBA = (request.security("WBA", "1", close))

WMTema9 = ta.ema(request.security("WMT", "1", close), 9)
WMTema = ta.ema(request.security("WMT", "1", close), 20)
WMTVWap = ta.vwap(request.security("WMT", "1", close))
WMT = (request.security("WMT", "1", close))

DISema9 = ta.ema(request.security("DIS", "1", close), 9)
DISema = ta.ema(request.security("DIS", "1", close), 20)
DISVWap = ta.vwap(request.security("DIS", "1", close))
DIS = (request.security("DIS", "1", close))

DOWema9 = ta.ema(request.security("DOW", "1", close), 9)
DOWema = ta.ema(request.security("DOW", "1", close), 20)
DOWVWap = ta.vwap(request.security("DOW", "1", close))
DOW = (request.security("DOW", "1", close))

MCDema9 = ta.ema(request.security("MCD", "1", close), 9)
MCDema = ta.ema(request.security("MCD", "1", close), 20)
MCDVWap = ta.vwap(request.security("MCD", "1", close))
MCD = (request.security("MCD", "1", close))



//STOCK GREATER THAN VWAP = BULL
//SET MAX VALUE OF BULLS TO 1 
//SET MIN VALUE OF BULLS TO 0 

//STOCK AXP || STOCK NUMBER 0
//STOCK GREATER THAN VWAP = BULLISH 

float AXPB= 0
isabove = (AXP > AXPVwap)
if isabove 
    AXPB := 3.155847
else 
    AXPB := 0

//STOCK NUMBER 0
//BEARS 
float AXPb = 0
isbelow = (AXP < AXPVwap)
if isbelow 
    AXPb := 3.155847
else 
    AXPb := 0
    
//STOCK AXP || STOCK NUMBER 0
//EMA CALCULATION

float AXPE= 0
above0 = (AXP > AXPema)
if above0
    AXPE := 3.155847
else 
    AXPE := 0

//STOCK NUMBER 0
//BEARS EMA CALCULATION
float AXPe = 0
below0 = (AXP < AXPema)
if below0
    AXPe := 3.155847
else 
    AXPe := 0

//STOCK AXP || STOCK NUMBER 0
//EMA CALCULATION 9

float AXPEE= 0
above00 = (AXP > AXPema9)
if above00
    AXPEE := 3.155847
else 
    AXPEE := 0

//STOCK NUMBER 0
//BEARS EMA 9 CALCULATION
float AXPee = 0
below00 = (AXP < AXPema9)
if below00
    AXPee := 3.155847
else 
    AXPee := 0

//STOCK AMGN || STOCK NUMBER 1
//STOCK GREATER THAN VWAP = BULLISH 
float AMGNB= 0
isabove1 = (AMGN > AMGNVwap)
if isabove1 
    AMGNB := 4.961912
else 
    AMGNB := 0

//STOCK NUMBER 1
//BEARS 
float AMGNb = 0
isbelow1 = (AMGN < AMGNVwap)
if isbelow1
    AMGNb := 4.961912
else 
    AMGNb := 0

//STOCK AMGN || STOCK NUMBER 1
//EMA CALCULATION

float AMGNE= 0
above1 = (AMGN > AMGNema)
if above1
    AMGNE := 4.961912
else 
    AMGNE := 0

//STOCK NUMBER 1
//BEARS EMA CALCULATION
float AMGNe = 0
below1 = (AMGN < AMGNema)
if below1
    AMGNe := 4.961912
else 
    AMGNe := 0

//STOCK AMGN || STOCK NUMBER 1
//EMA 9 CALCULATION

float AMGNEE= 0
above01 = (AMGN > AMGNema9)
if above01
    AMGNEE := 4.961912
else 
    AMGNEE := 0

//STOCK NUMBER 1
//BEARS EMA CALCULATION
float AMGNee = 0
below01 = (AMGN < AMGNema9)
if below01
    AMGNee := 4.961912
else 
    AMGNee := 0

//STOCK AAPL || STOCK NUMBER 2
//STOCK GREATER THAN VWAP = BULLISH 

float AAPLB= 0
isabove2 = (AAPL > AAPLVwap)
if isabove2 
    AAPLB := 3.308142
else 
    AAPLB := 0

//STOCK NUMBER 2
//BEARS 
float AAPLb = 0
isbelow2 = (AAPL < AAPLVwap)
if isbelow2
    AAPLb := 3.308142
else 
    AAPLb := 0

//STOCK AAPL || STOCK NUMBER 2
//EMA CALCULATION

float AAPLE= 0
above2 = (AAPL > AAPLema)
if above2
    AAPLE := 3.308142
else 
    AAPLE := 0

//STOCK NUMBER 2
//BEARS EMA CALCULATION
float AAPLe = 0
below2 = (AAPL < AAPLema)
if below2
    AAPLe := 3.308142
else 
    AAPLe := 0

//STOCK AAPL || STOCK NUMBER 2
//EMA 9 CALCULATION

float AAPLEE= 0
above02 = (AAPL > AAPLema9)
if above02
    AAPLEE := 3.308142
else 
    AAPLEE := 0

//STOCK NUMBER 2
//BEARS EMA 9 CALCULATION
float AAPLee = 0
below02 = (AAPL < AAPLema9)
if below02
    AAPLee := 3.308142
else 
    AAPLee := 0

//STOCK BA || STOCK NUMBER 3
//STOCK GREATER THAN VWAP = BULLISH 

float BAB= 0
isabove3 = (BA > BAVwap)
if isabove3
    BAB := 3.328608
else 
    BAB := 0

//STOCK NUMBER 3
//BEARS 
float BAb = 0
isbelow3 = (BA < BAVwap)
if isbelow3
    BAb := 3.328608
else 
    BAb := 0
    
//STOCK BA || STOCK NUMBER 3
//EMA CALCULATION

float BAE= 0
above3 = (BA > BAema)
if above3
    BAE := 3.328608
else 
    BAE := 0

//STOCK NUMBER 3
//BEARS EMA CALCULATION
float BAe = 0
below3 = (BA < BAema)
if below3
    BAe := 3.328608
else 
    BAe := 0
    
//STOCK BA || STOCK NUMBER 3
//EMA 9 CALCULATION

float BAEE= 0
above03 = (BA > BAema9)
if above03
    BAEE := 3.328608
else 
    BAEE := 0

//STOCK NUMBER 3
//BEARS EMA CALCULATION
float BAee = 0
below03 = (BA < BAema9)
if below03
    BAee := 3.328608
else 
    BAee := 0

//STOCK CAT || STOCK NUMBER 4
//STOCK GREATER THAN VWAP = BULLISH 

float CATB= 0
isabove4 = (CAT > CATVwap)
if isabove4
    CATB := 3.728306
else 
    CATB := 0

//STOCK NUMBER 4
//BEARS 
float CATb = 0
isbelow4 = (CAT < CATVwap)
if isbelow4
    CATb := 3.728306
else 
    CATb := 0

//STOCK CAT || STOCK NUMBER 4
//EMA CALCULATION

float CATE= 0
above4 = (CAT > CATema)
if above4
    CATE := 3.728306
else 
    CATE := 0

//STOCK NUMBER 4
//BEARS EMA CALCULATION
float CATe = 0
below4 = (CAT < CATema)
if below4
    CATe := 3.728306
else 
    CATe := 0

//STOCK CAT || STOCK NUMBER 4
//EMA CALCULATION

float CATEE= 0
above04 = (CAT > CATema9)
if above04
    CATEE := 3.728306
else 
    CATEE := 0

//STOCK NUMBER 4
//BEARS EMA CALCULATION
float CATee = 0
below04 = (CAT < CATema9)
if below04
    CATee := 3.728306
else 
    CATee := 0

//STOCK CSCO || STOCK NUMBER 5
//STOCK GREATER THAN VWAP = BULLISH 

float CSCOB= 0
isabove5 = (CSCO > CSCOVwap)
if isabove5
    CSCOB := 0.903333
else 
    CSCOB := 0

//STOCK NUMBER 5
//BEARS 
float CSCOb = 0
isbelow5 = (CSCO < CSCOVwap)
if isbelow5
    CSCOb := 0.903333
else 
    CSCOb := 0

//STOCK CSCO || STOCK NUMBER 5
//EMA CALCULATION

float CSCOE= 0
above5 = (CSCO > CSCOema)
if above5
    CSCOE := 0.903333
else 
    CSCOE := 0

//STOCK NUMBER 5
//BEARS EMA CALCULATION
float CSCOe = 0
below5 = (CSCO < CSCOema)
if below5
    CSCOe := 0.903333
else 
    CSCOe := 0

//STOCK CSCO || STOCK NUMBER 5
//EMA 9 CALCULATION

float CSCOEE= 0
above05 = (CSCO > CSCOema9)
if above05
    CSCOEE := 0.903333
else 
    CSCOEE := 0

//STOCK NUMBER 5
//BEARS EMA CALCULATION
float CSCOee = 0
below05 = (CSCO < CSCOema9)
if below05
    CSCOee := 0.903333
else 
    CSCOee := 0

//STOCK CVX || STOCK NUMBER 6
//STOCK GREATER THAN VWAP = BULLISH 

float CVXB= 0
isabove6 = (CVX > CVXVwap)
if isabove6
    CVXB := 3.078195
else 
    CVXB := 0

//STOCK NUMBER 6
//BEARS 
float CVXb = 0
isbelow6 = (CVX < CVXVwap)
if isbelow6
    CVXb := 3.078195
else 
    CVXb := 0

//STOCK CVX || STOCK NUMBER 6
//EMA CALCULATION

float CVXE= 0
above6 = (CVX > CVXema)
if above6
    CVXE := 3.078195
else 
    CVXE := 0

//STOCK NUMBER 6
//BEARS EMA CALCULATION
float CVXe = 0
below6 = (CVX < CVXema)
if below6
    CVXe := 3.078195
else 
    CVXe := 0

//STOCK CVX || STOCK NUMBER 6
//EMA 9 CALCULATION

float CVXEE= 0
above06 = (CVX > CVXema9)
if above06
    CVXEE := 3.078195
else 
    CVXEE := 0

//STOCK NUMBER 6
//BEARS EMA CALCULATION
float CVXee = 0
below06 = (CVX < CVXema9)
if below06
    CVXee := 3.078195
else 
    CVXee := 0

//STOCK GS || STOCK NUMBER 7
//STOCK GREATER THAN VWAP = BULLISH 

float GSB= 0
isabove7 = (GS > GSWap)
if isabove7
    GSB := 6.715406
else 
    GSB := 0

//STOCK NUMBER 7
//BEARS 
float GSb = 0
isbelow7 = (GS < GSWap)
if isbelow7
    GSb := 6.715406
else 
    GSb := 0

//STOCK GS || STOCK NUMBER 7
//EMA CALCULATION

float GSE= 0
above7 = (GS > GSema)
if above7
    GSE := 6.715406
else 
    GSE := 0

//STOCK NUMBER 7
//BEARS EMA CALCULATION
float GSe = 0
below7 = (GS < GSema)
if below7
    GSe := 6.715406
else 
    GSe := 0

//STOCK GS || STOCK NUMBER 7
//EMA CALCULATION

float GSEE= 0
above07 = (GS > GSema9)
if above07
    GSEE := 6.715406
else 
    GSEE := 0

//STOCK NUMBER 7
//BEARS EMA CALCULATION
float GSee = 0
below07 = (GS < GSema9)
if below07
    GSee := 6.715406
else 
    GSee := 0

//STOCK HD || STOCK NUMBER 8
//STOCK GREATER THAN VWAP = BULLISH 

float HDB= 0
isabove8 = (HD > HDVWap)
if isabove8
    HDB := 6.259726
else 
    HDB := 0

//STOCK NUMBER 8
//BEARS 
float HDb = 0
isbelow8 = (HD < HDVWap)
if isbelow8
    HDb := 6.259726
else 
    HDb := 0

//STOCK HD || STOCK NUMBER 8
//EMA CALCULATION

float HDE= 0
above8 = (HD > HDema)
if above8
    HDE := 6.259726
else 
    HDE := 0

//STOCK NUMBER 8
//BEARS EMA CALCULATION
float HDe = 0
below8 = (HD < HDema)
if below8
    HDe := 6.259726
else 
    HDe := 0
    
//STOCK HD || STOCK NUMBER 8
//EMA CALCULATION

float HDEE= 0
above08 = (HD > HDema9)
if above08
    HDEE := 6.259726
else 
    HDEE := 0

//STOCK NUMBER 8
//BEARS EMA CALCULATION
float HDee = 0
below08 = (HD < HDema9)
if below08
    HDee := 6.259726
else 
    HDee := 0
    
//STOCK HON || STOCK NUMBER 9
//STOCK GREATER THAN VWAP = BULLISH 

float HONB= 0
isabove9 = (HON > HONVWap)
if isabove9
    HONB := 3.892038
else 
    HONB := 0

//STOCK NUMBER 9
//BEARS 
float HONb = 0
isbelow9 = (HON < HONVWap)
if isbelow9
    HONb := 3.892038
else 
    HONb := 0

//STOCK HON || STOCK NUMBER 9
//EMA CALCULATION

float HONE= 0
above9 = (HON > HONema)
if above9
    HONE := 3.892038
else 
    HONE := 0

//STOCK NUMBER 9
//BEARS EMA CALCULATION
float HONe = 0
below9 = (HON < HONema)
if below9
    HONe := 3.892038
else 
    HONe := 0

//STOCK HON || STOCK NUMBER 9
//EMA CALCULATION

float HONEE= 0
above09 = (HON > HONema9)
if above09
    HONEE := 3.892038
else 
    HONEE := 0

//STOCK NUMBER 9
//BEARS EMA CALCULATION
float HONee = 0
below09 = (HON < HONema9)
if below09
    HONee := 3.892038
else 
    HONee := 0

//STOCK IBM || STOCK NUMBER 10
//STOCK GREATER THAN VWAP = BULLISH 

float IBMB= 0
isabove10 = (IBM > IBMVWap)
if isabove10
    IBMB := 2.66084
else 
    IBMB := 0

//STOCK NUMBER 10
//BEARS 
float IBMb = 0
isbelow10 = (IBM < IBMVWap)
if isbelow10
    IBMb := 2.66084
else 
    IBMb := 0

//STOCK IBM || STOCK NUMBER 10
//EMA CALCULATION

float IBME= 0
above10 = (IBM > IBMema)
if above10
    IBME := 2.66084
else 
    IBME := 0

//STOCK NUMBER 10
//BEARS EMA CALCULATION
float IBMe = 0
below10 = (IBM < IBMema)
if below10
    IBMe := 2.66084
else 
    IBMe := 0

//STOCK IBM || STOCK NUMBER 10
//EMA CALCULATION

float IBMEE= 0
above010 = (IBM > IBMema9)
if above010
    IBMEE := 2.66084
else 
    IBMEE := 0

//STOCK NUMBER 10
//BEARS EMA CALCULATION
float IBMee = 0
below010 = (IBM < IBMema9)
if below010
    IBMee := 2.66084
else 
    IBMee := 0

//STOCK INTC || STOCK NUMBER 11
//STOCK GREATER THAN VWAP = BULLISH 

float INTCB= 0
isabove11 = (INTC > INTCVWap)
if isabove11
    INTCB := 0.709905
else 
    INTCB := 0

//STOCK NUMBER 11
//BEARS 
float INTCb = 0
isbelow11 = (INTC < INTCVWap)
if isbelow11
    INTCb := 0.709905
else 
    INTCb := 0

//STOCK INTC || STOCK NUMBER 11
//EMA CALCULATION

float INTCE= 0
above11 = (INTC > INTCema)
if above11
    INTCE := 0.709905
else 
    INTCE := 0

//STOCK NUMBER 11
//BEARS EMA CALCULATION
float INTCe = 0
below11 = (INTC < INTCema)
if below11
    INTCe := 0.709905
else 
    INTCe := 0

//STOCK INTC || STOCK NUMBER 11
//EMA CALCULATION

float INTCEE= 0
above011 = (INTC > INTCema9)
if above011
    INTCEE := 0.709905
else 
    INTCEE := 0

//STOCK NUMBER 11
//BEARS EMA CALCULATION
float INTCee = 0
below011 = (INTC < INTCema9)
if below011
    INTCee := 0.709905
else 
    INTCee := 0

//STOCK JNJ || STOCK NUMBER 12
//STOCK GREATER THAN VWAP = BULLISH 

float JNJB= 0
isabove12 = (JNJ > JNJVWap)
if isabove12
    JNJB := 3.415089
else 
    JNJB := 0

//STOCK NUMBER 12
//BEARS 
float JNJb = 0
isbelow12 = (JNJ < JNJVWap)
if isbelow12
    JNJb := 3.415089
else 
    JNJb := 0

//STOCK JNJ || STOCK NUMBER 12
//EMA CALCULATION

float JNJE= 0
above12 = (JNJ > JNJema)
if above12
    JNJE := 3.415089
else 
    JNJE := 0

//STOCK NUMBER 12
//BEARS EMA CALCULATION
float JNJe = 0
below12 = (JNJ < JNJema)
if below12
    JNJe := 3.415089
else 
    JNJe := 0

//STOCK JNJ || STOCK NUMBER 12
//EMA CALCULATION

float JNJEE= 0
above012 = (JNJ > JNJema9)
if above12
    JNJEE := 3.415089
else 
    JNJEE := 0

//STOCK NUMBER 12
//BEARS EMA CALCULATION
float JNJee = 0
below012 = (JNJ < JNJema9)
if below012
    JNJee := 3.415089
else 
    JNJee := 0
    
//STOCK KO || STOCK NUMBER 13
//STOCK GREATER THAN VWAP = BULLISH 

float KOB= 0
isabove13 = (KO > KOVWap)
if isabove13
    KOB := 1.263503
else 
    KOB := 0

//STOCK NUMBER 13
//BEARS 
float KOb = 0
isbelow13 = (KO < KOVWap)
if isbelow13
    KOb := 1.263503
else 
    KOb := 0

//STOCK KO || STOCK NUMBER 13
//EMA CALCULATION

float KOE= 0
above13 = (KO > KOema)
if above13
    KOE := 1.263503
else 
    KOE := 0

//STOCK NUMBER 13
//BEARS EMA CALCULATION
float KOe = 0
below13 = (KO < KOema)
if below13
    KOe := 1.263503
else 
    KOe := 0
    
//STOCK KO || STOCK NUMBER 13
//EMA CALCULATION

float KOEE= 0
above013 = (KO > KOema9)
if above013
    KOEE := 1.263503
else 
    KOEE := 0

//STOCK NUMBER 13
//BEARS EMA CALCULATION
float KOee = 0
below013 = (KO < KOema9)
if below013
    KOee := 1.263503
else 
    KOee := 0

//STOCK JPM || STOCK NUMBER 14
//STOCK GREATER THAN VWAP = BULLISH 

float JPMB= 0
isabove14 = (JPM > JPMVWap)
if isabove14
    JPMB := 2.29445
else 
    JPMB := 0

//STOCK NUMBER 14
//BEARS 
float JPMb = 0
isbelow14 = (JPM < JPMVWap)
if isbelow14
    JPMb := 2.29445
else 
    JPMb := 0

//STOCK JPM || STOCK NUMBER 14
//EMA CALCULATION

float JPME= 0
above14 = (JPM > JPMema)
if above14
    JPME := 2.29445
else 
    JPME := 0

//STOCK NUMBER 14
//BEARS EMA CALCULATION
float JPMe = 0
below14 = (JPM < JPMema)
if below14
    JPMe := 2.29445
else 
    JPMe := 0

//STOCK JPM || STOCK NUMBER 14
//EMA CALCULATION

float JPMEE= 0
above014 = (JPM > JPMema9)
if above014
    JPMEE := 2.29445
else 
    JPMEE := 0

//STOCK NUMBER 14
//BEARS EMA CALCULATION
float JPMee = 0
below014 = (JPM < JPMema9)
if below014
    JPMee := 2.29445
else 
    JPMee := 0

//STOCK MMM || STOCK NUMBER 15
//STOCK GREATER THAN VWAP = BULLISH 

float MMMB= 0
isabove15 = (MMM > MMMVWap)
if isabove15
    MMMB := 2.979274
else 
    MMMB := 0

//STOCK NUMBER 15
//BEARS 
float MMMb = 0
isbelow15 = (MMM < MMMVWap)
if isbelow15
    MMMb := 2.979274
else 
    MMMb := 0

//STOCK MMM || STOCK NUMBER 15
//EMA CALCULATION

float MMME= 0
above15 = (MMM > MMMema)
if above15
    MMME := 2.979274
else 
    MMME := 0

//STOCK NUMBER 15
//BEARS EMA CALCULATION
float MMMe = 0
below15 = (MMM < MMMema)
if below15
    MMMe := 2.979274
else 
    MMMe := 0
    
//STOCK MMM || STOCK NUMBER 15
//EMA CALCULATION

float MMMEE= 0
above015 = (MMM > MMMema9)
if above015
    MMMEE := 2.979274
else 
    MMMEE := 0

//STOCK NUMBER 15
//BEARS EMA CALCULATION
float MMMee = 0
below015 = (MMM < MMMema9)
if below015
    MMMee := 2.979274
else 
    MMMee := 0


//STOCK MRK || STOCK NUMBER 16
//STOCK GREATER THAN VWAP = BULLISH 

float MRKB= 0
isabove16 = (MRK > MRKVWap)
if isabove16
    MRKB := 1.775565
else 
    MRKB := 0

//STOCK NUMBER 16
//BEARS 
float MRKb = 0
isbelow16 = (MRK < MRKVWap)
if isbelow16
    MRKb := 1.775565
else 
    MRKb := 0

//STOCK MRK || STOCK NUMBER 16
//EMA CALCULATION

float MRKE= 0
above16 = (MRK > MRKema)
if above16
    MRKE := 1.775565
else 
    MRKE := 0

//STOCK NUMBER 16
//BEARS EMA CALCULATION
float MRKe = 0
below16 = (MRK < MRKema)
if below16
    MRKe := 1.775565
else 
    MRKe := 0

//STOCK MRK || STOCK NUMBER 16
//EMA CALCULATION

float MRKEE= 0
above016 = (MRK > MRKema9)
if above016
    MRKEE := 1.775565
else 
    MRKEE := 0

//STOCK NUMBER 16
//BEARS EMA CALCULATION
float MRKee = 0
below016 = (MRK < MRKema9)
if below016
    MRKee := 1.775565
else 
    MRKee := 0

//STOCK MSFT || STOCK NUMBER 17
//STOCK GREATER THAN VWAP = BULLISH 

float MSFTB= 0
isabove17 = (MSFT > MSFTVWap)
if isabove17
    MSFTB := 5.624664
else 
    MSFTB := 0

//STOCK NUMBER 17
//BEARS 
float MSFTb = 0
isbelow17 = (MSFT < MSFTVWap)
if isbelow17
    MSFTb := 5.624664
else 
    MSFTb := 0

//STOCK MSFT || STOCK NUMBER 17
//EMA CALCULATION

float MSFTE= 0
above17 = (MSFT > MSFTema)
if above17
    MSFTE := 5.624664
else 
    MSFTE := 0

//STOCK NUMBER 17
//BEARS EMA CALCULATION
float MSFTe = 0
below17 = (MSFT < MSFTema)
if below17
    MSFTe := 5.624664
else 
    MSFTe := 0

//STOCK MSFT || STOCK NUMBER 17
//EMA CALCULATION

float MSFTEE= 0
above017 = (MSFT > MSFTema9)
if above017
    MSFTEE := 5.624664
else 
    MSFTEE := 0

//STOCK NUMBER 17
//BEARS EMA CALCULATION
float MSFTee = 0
below017 = (MSFT < MSFTema9)
if below017
    MSFTee := 5.624664
else 
    MSFTee := 0
    
//STOCK NKE || STOCK NUMBER 18
//STOCK GREATER THAN VWAP = BULLISH 

float NKEB= 0
isabove18 = (NKE > NKEVWap)
if isabove18
    NKEB := 2.287427
else 
    NKEB := 0

//STOCK NUMBER 18
//BEARS 
float NKEb = 0
isbelow18 = (NKE < NKEVWap)
if isbelow18
    NKEb := 2.287427
else 
    NKEb := 0

//STOCK NKE || STOCK NUMBER 18
//EMA CALCULATION

float NKEE= 0
above18 = (NKE > NKEema)
if above18
    NKEE := 2.287427
else 
    NKEE := 0

//STOCK NUMBER 18
//BEARS EMA CALCULATION
float NKEe = 0
below18 = (NKE < NKEema)
if below18
    NKEe := 2.287427
else 
    NKEe := 0
    
//STOCK NKE || STOCK NUMBER 18
//EMA CALCULATION

float NKEEE= 0
above018 = (NKE > NKEema9)
if above018
    NKEEE := 2.287427
else 
    NKEEE := 0

//STOCK NUMBER 18
//BEARS EMA CALCULATION
float NKEee = 0
below018 = (NKE < NKEema9)
if below018
    NKEee := 2.287427
else 
    NKEee := 0
    
//STOCK PG || STOCK NUMBER 19
//STOCK GREATER THAN VWAP = BULLISH 

float PGB= 0
isabove19 = (PG > PGVWap)
if isabove19
    PGB := 2.914865
else 
    PGB := 0

//STOCK NUMBER 19
//BEARS 
float PGb = 0
isbelow19 = (PG < PGVWap)
if isbelow19
    PGb := 2.914865
else 
    PGb := 0

//STOCK PG || STOCK NUMBER 19
//EMA CALCULATION

float PGE= 0
above19 = (PG > PGema)
if above19
    PGE := 2.914865
else 
    PGE := 0

//STOCK NUMBER 19
//BEARS EMA CALCULATION
float PGe = 0
below19 = (PG < PGema)
if below19
    PGe := 2.914865
else 
    PGe := 0

//STOCK PG || STOCK NUMBER 19
//EMA CALCULATION

float PGEE= 0
above019 = (PG > PGema9)
if above019
    PGEE := 2.914865
else 
    PGEE := 0

//STOCK NUMBER 19
//BEARS EMA CALCULATION
float PGee = 0
below019 = (PG < PGema9)
if below019
    PGee := 2.914865
else 
    PGee := 0

//STOCK TRV || STOCK NUMBER 20
//STOCK GREATER THAN VWAP = BULLISH 

float TRVB= 0
isabove20 = (TRV > TRVVWap)
if isabove20
    TRVB := 3.210023
else 
    TRVB := 0

//STOCK NUMBER 20
//BEARS 
float TRVb = 0
isbelow20 = (TRV < TRVVWap)
if isbelow20
    TRVb := 3.210023
else 
    TRVb := 0

//STOCK TRV || STOCK NUMBER 20
//EMA CALCULATION

float TRVE= 0
above20 = (TRV > TRVema)
if above20
    TRVE := 3.210023
else 
    TRVE := 0

//STOCK NUMBER 20
//BEARS EMA CALCULATION
float TRVe = 0
below20 = (TRV < TRVema)
if below20
    TRVe := 3.210023
else 
    TRVe := 0

//STOCK TRV || STOCK NUMBER 20
//EMA CALCULATION

float TRVEE= 0
above020 = (TRV > TRVema9)
if above020
    TRVEE := 3.210023
else 
    TRVEE := 0

//STOCK NUMBER 20
//BEARS EMA CALCULATION
float TRVee = 0
below020 = (TRV < TRVema9)
if below020
    TRVee := 3.210023
else 
    TRVee := 0

//STOCK UNH || STOCK NUMBER 21
//STOCK GREATER THAN VWAP = BULLISH 

float UNHB= 0
isabove21 = (UNH > UNHVWap)
if isabove21
    UNHB := 10.766961
else 
    UNHB := 0

//STOCK NUMBER 21
//BEARS 
float UNHb = 0
isbelow21 = (UNH < UNHVWap)
if isbelow21
    UNHb := 1
else 
    UNHb := 0

//STOCK UNH || STOCK NUMBER 21
//EMA CALCULATION

float UNHE= 0
above21 = (UNH > UNHema)
if above21
    UNHE := 10.766961
else 
    UNHE := 0

//STOCK NUMBER 21
//BEARS EMA CALCULATION
float UNHe = 0
below21 = (UNH < UNHema)
if below21
    UNHe := 10.766961
else 
    UNHe := 0

//STOCK UNH || STOCK NUMBER 21
//EMA CALCULATION

float UNHEE= 0
above021 = (UNH > UNHema9)
if above021
    UNHEE := 10.766961
else 
    UNHEE := 0

//STOCK NUMBER 21
//BEARS EMA CALCULATION
float UNHee = 0
below021 = (UNH < UNHema9)
if below021
    UNHee := 10.766961
else 
    UNHee := 0

//STOCK CRM || STOCK NUMBER 22
//STOCK GREATER THAN VWAP = BULLISH 

float CRMB= 0
isabove22 = (CRM > CRMVWap)
if isabove22
    CRMB := 3.807363
else 
    CRMB := 0

//STOCK NUMBER 22
//BEARS 
float CRMb = 0
isbelow22 = (CRM < CRMVWap)
if isbelow22
    CRMb := 3.807363
else 
    CRMb := 0

//STOCK CRM || STOCK NUMBER 22
//EMA CALCULATION

float CRME= 0
above22 = (CRM > CRMema)
if above22
    CRME := 3.807363
else 
    CRME := 0

//STOCK NUMBER 22
//BEARS EMA CALCULATION
float CRMe = 0
below22 = (CRM < CRMema)
if below22
    CRMe := 3.807363
else 
    CRMe := 0

//STOCK CRM || STOCK NUMBER 22
//EMA CALCULATION

float CRMEE= 0
above022 = (CRM > CRMema9)
if above022
    CRMEE := 3.807363
else 
    CRMEE := 0

//STOCK NUMBER 22
//BEARS EMA CALCULATION
float CRMee = 0
below022 = (CRM < CRMema9)
if below022
    CRMee := 3.807363
else 
    CRMee := 0
    
//STOCK VZ || STOCK NUMBER 23
//STOCK GREATER THAN VWAP = BULLISH 

float VZB= 0
isabove23 = (VZ > VZVWap)
if isabove23
    VZB := 0.893702
else 
    VZB := 0

//STOCK NUMBER 23
//BEARS 
float VZb = 0
isbelow23 = (VZ < VZVWap)
if isbelow23
    VZb := 0.893702
else 
    VZb := 0

//STOCK VZ || STOCK NUMBER 23
//EMA CALCULATION

float VZE= 0
above23 = (VZ > VZema)
if above23
    VZE := 0.893702
else 
    VZE := 0

//STOCK NUMBER 23
//BEARS EMA CALCULATION
float VZe = 0
below23 = (VZ < VZema)
if below23
    VZe := 0.893702
else 
    VZe := 0

//STOCK VZ || STOCK NUMBER 23
//EMA CALCULATION

float VZEE= 0
above023 = (VZ > VZema9)
if above023
    VZEE := 0.893702
else 
    VZEE := 0

//STOCK NUMBER 23
//BEARS EMA CALCULATION
float VZee = 0
below023 = (VZ < VZema9)
if below023
    VZee := 0.893702
else 
    VZee := 0

//STOCK V || STOCK NUMBER 24
//STOCK GREATER THAN VWAP = BULLISH 

float VB= 0
isabove24 = (V > VVWap)
if isabove24
    VB := 4.280299
else 
    VB := 0

//STOCK NUMBER 24
//BEARS 
float Vb = 0
isbelow24 = (V < VVWap)
if isbelow24
    Vb := 4.280299
else 
    Vb := 0

//STOCK V || STOCK NUMBER 24
//EMA CALCULATION

float VE= 0
above24 = (V > Vema)
if above24
    VE := 4.280299
else 
    VE := 0

//STOCK NUMBER 24
//BEARS EMA CALCULATION
float Ve = 0
below24 = (V < Vema)
if below24
    Ve := 4.280299
else 
    Ve := 0

//STOCK V || STOCK NUMBER 24
//EMA CALCULATION

float VEE= 0
above024 = (V > Vema9)
if above024
    VEE := 4.280299
else 
    VEE := 0

//STOCK NUMBER 24
//BEARS EMA CALCULATION
float Vee = 0
below024 = (V < Vema9)
if below024
    Vee := 4.280299
else 
    Vee := 0

//STOCK WBA || STOCK NUMBER 25
//STOCK GREATER THAN VWAP = BULLISH 

float WBAB= 0
isabove25 = (WBA > WBAVWap)
if isabove25
    WBAB := 0.792172
else 
    WBAB := 0

//STOCK NUMBER 25
//BEARS 
float WBAb = 0
isbelow25 = (WBA < WBAVWap)
if isbelow25
    WBAb := 0.792172
else 
    WBAb := 0

//STOCK WBA || STOCK NUMBER 25
//EMA CALCULATION

float WBAE= 0
above25 = (WBA > WBAema)
if above25
    WBAE := 0.792172
else 
    WBAE := 0

//STOCK NUMBER 25
//BEARS EMA CALCULATION
float WBAe = 0
below25 = (WBA < WBAema)
if below25
    WBAe := 0.792172
else 
    WBAe := 0

//STOCK WBA || STOCK NUMBER 25
//EMA CALCULATION

float WBAEE= 0
above025 = (WBA > WBAema9)
if above025
    WBAEE := 0.792172
else 
    WBAEE := 0

//STOCK NUMBER 25
//BEARS EMA CALCULATION
float WBAee = 0
below025 = (WBA < WBAema9)
if below025
    WBAee := 0.792172
else 
    WBAee := 0

//STOCK WMT || STOCK NUMBER 26
//STOCK GREATER THAN VWAP = BULLISH 

float WMTB= 0
isabove26 = (WMT > WMTVWap)
if isabove26
    WMTB := 2.560514
else 
    WMTB := 0

//STOCK NUMBER 26
//BEARS 
float WMTb = 0
isbelow26 = (WMT < WMTVWap)
if isbelow26
    WMTb := 2.560514
else 
    WMTb := 0

//STOCK WMT || STOCK NUMBER 26
//EMA CALCULATION

float WMTE= 0
above26 = (WMT > WMTema)
if above26
    WMTE := 2.560514
else 
    WMTE := 0

//STOCK NUMBER 26
//BEARS EMA CALCULATION
float WMTe = 0
below26 = (WMT < WMTema)
if below26
    WMTe := 2.560514
else 
    WMTe := 0

//STOCK WMT || STOCK NUMBER 26
//EMA CALCULATION

float WMTEE= 0
above026 = (WMT > WMTema9)
if above026
    WMTEE := 2.560514
else 
    WMTEE := 0

//STOCK NUMBER 26
//BEARS EMA CALCULATION
float WMTee = 0
below026 = (WMT < WMTema9)
if below026
    WMTee := 2.560514
else 
    WMTee := 0

//STOCK DIS || STOCK NUMBER 27
//STOCK GREATER THAN VWAP = BULLISH 

float DISB= 0
isabove27 = (DIS > DISVWap)
if isabove27
    DISB := 2.189309
else 
    DISB := 0

//STOCK NUMBER 27
//BEARS 
float DISb = 0
isbelow27 = (DIS < DISVWap)
if isbelow27
    DISb := 2.189309
else 
    DISb := 0

//STOCK DIS || STOCK NUMBER 27
//EMA CALCULATION

float DISE= 0
above27 = (DIS > DISema)
if above27
    DISE := 2.189309
else 
    DISE := 0

//STOCK NUMBER 27
//BEARS EMA CALCULATION
float DISe = 0
below27 = (DIS < DISema)
if below27
    DISe := 2.189309
else 
    DISe := 0

//STOCK DIS || STOCK NUMBER 27
//EMA CALCULATION

float DISEE= 0
above027 = (DIS > DISema9)
if above027
    DISEE := 2.189309
else 
    DISEE := 0

//STOCK NUMBER 27
//BEARS EMA CALCULATION
float DISee = 0
below027 = (DIS < DISema9)
if below027
    DISee := 2.189309
else 
    DISee := 0


//STOCK DOW || STOCK NUMBER 28
//STOCK GREATER THAN VWAP = BULLISH 

float DOWB= 0
isabove28 = (DOW > DOWVWap)
if isabove28
    DOWB := 1.046403
else 
    DOWB := 0

//STOCK NUMBER 28
//BEARS 
float DOWb = 0
isbelow28 = (DOW < DOWVWap)
if isbelow28
    DOWb := 1.046403
else 
    DOWb := 0

//STOCK DOW || STOCK NUMBER 28
//EMA CALCULATION

float DOWE= 0
above28 = (DOW > DOWema)
if above28
    DOWE := 1.046403
else 
    DOWE := 0

//STOCK NUMBER 28
//BEARS EMA CALCULATION
float DOWe = 0
below28 = (DOW < DOWema)
if below28
    DOWe := 1.046403
else 
    DOWe := 0

//STOCK DOW || STOCK NUMBER 28
//EMA CALCULATION

float DOWEE= 0
above028 = (DOW > DOWema9)
if above028
    DOWEE := 1.046403
else 
    DOWEE := 0

//STOCK NUMBER 28
//BEARS EMA CALCULATION
float DOWee = 0
below028 = (DOW < DOWema9)
if below028
    DOWee := 1.046403
else 
    DOWee := 0
    
//STOCK MCD || STOCK NUMBER 29
//STOCK GREATER THAN VWAP = BULLISH 

float MCDB= 0
isabove29 = (MCD > MCDVWap)
if isabove29
    MCDB := 5.152731
else 
    MCDB := 0

//STOCK NUMBER 29
//BEARS 
float MCDb = 0
isbelow29 = (MCD < MCDVWap)
if isbelow29
    MCDb := 5.152731
else 
    MCDb := 0

//STOCK MCD || STOCK NUMBER 29
//EMA CALCULATION

float MCDE= 0
above29 = (MCD > MCDema)
if above29
    MCDE := 5.152731
else 
    MCDE := 0

//STOCK NUMBER 29
//BEARS EMA CALCULATION
float MCDe = 0
below29 = (MCD < MCDema)
if below29
    MCDe := 5.152731
else 
    MCDe := 0
    
//STOCK MCD || STOCK NUMBER 29
//EMA CALCULATION

float MCDEE= 0
above029 = (MCD > MCDema9)
if above029
    MCDEE := 5.152731
else 
    MCDEE := 0

//STOCK NUMBER 29
//BEARS EMA CALCULATION
float MCDee = 0
below029 = (MCD < MCDema9)
if below029
    MCDee := 5.152731
else 
    MCDee := 0
    


    


//PLOTS ALL STOCKS ABOVE 20 EMA = BULLema20
//PLOTS ALL STOCKS BELOW 20 EMA = BEARema20

BULLema20 = AXPE + AMGNE + AAPLE + BAE + CATE + CSCOE + CVXE + GSE + HDE + HONE + IBME + INTCE + JNJE + KOE + JPME + MMME + MRKE + MSFTE + NKEE + PGE + TRVE + UNHE + CRME + VZE + VE + WBAE + WMTE + DISE + DOWE + MCDE
BEARema20 = AXPe + AMGNe + AAPLe + BAe + CATe + CSCOe + CVXe + GSe + HDe + HONe + IBMe + INTCe + JNJe + KOe + JPMe + MMMe + MRKe + MSFTe + NKEe + PGe + TRVe + UNHe + CRMe + VZe + Ve + WBAe + WMTe + DISe + DOWe + MCDe

//plot(BULLema20, "20ema.BULLS", color.blue,1)
//plot(BEARema20, "20ema.BEARS", color.orange,1)

//PLOT ALL STOCKS ABOVE 9 EMA = BULLema9
//PLOT ALL STOCKS BELOW 9 EMA = BULLema9

BULLema9 = AXPEE + AMGNEE + AAPLEE + BAEE + CATEE + CSCOEE + CVXEE + GSEE + HDEE + HONEE + IBMEE + INTCEE + JNJEE + KOEE + JPMEE + MMMEE + MRKEE + MSFTEE + NKEEE + PGEE + TRVEE + UNHEE + CRMEE + VZEE + VEE + WBAEE + WMTEE + DISEE + DOWEE + MCDEE
BEARema9 = AXPee + AMGNee + AAPLee + BAee + CATee + CSCOee + CVXee + GSee + HDee + HONee + IBMee + INTCee + JNJee + KOee + JPMee + MMMee + MRKee + MSFTee + NKEee + PGee + TRVee + UNHee + CRMee + VZee + Vee + WBAee + WMTee + DISee + DOWee + MCDee

//plot(BULLema9, "9ema.BULLS", color.blue,1)
//plot(BEARema9, "9ema.BEARS", color.orange,1)


//Total Bull EMA = All Bullish EMA Values /Divided/ by 2 
TotalBULLema = (BULLema20 + BULLema9) / 2

plot(TotalBULLema, "ema.BULLS", color = color.rgb(131, 171, 230, 80),linewidth = 1, style = plot.style_area)


//Total Bear EMA = ALL Bearish EMA Values /Divided/ by 2 
TotalBEARema = (BEARema20 + BEARema9) / 2 

plot(TotalBEARema, "ema.BEARS", color = color.rgb(255, 0, 0, 95), linewidth = 1, style = plot.style_area)

//PLOTS ALL STOCKS ABOVE VWAP = TOTAL BULLS
//PLOTS ALL STOCKS BELOW VWAP = TOTAL BEARS 
TOTALBULLS = AXPB + AMGNB + AAPLB + BAB + CATB + CSCOB + CVXB + GSB + HONB + HDB + IBMB + INTCB + JNJB + KOB + JPMB + MMMB + MRKB + MSFTB + NKEB + PGB + TRVB + UNHB + CRMB + VZB + VB + WBAB + WMTB + DISB + DOWB + MCDB
TOTALBEARS = AXPb + AMGNb + AAPLb + BAb + CATb + CSCOb + CVXb + GSb + HONb + HDb + IBMb + INTCb + JNJb + KOb + JPMb + MMMb + MRKb + MSFTb + NKEb + PGb + TRVb + UNHb + CRMb + VZb + Vb + WBAb + WMTb + DISb + DOWb + MCDb

plot(TOTALBULLS, "Vwap.BULLS", color.green,3)
plot(TOTALBEARS, "Vwap.BEARS", color.red,3)





// Request SIMPLE ADVANCED/DECLINE DOW JONES 
ADVDEC = request.security("ADVDEC.DJ", "1", close)
ADVDEC0 = ADVDEC * 1.666666666666666666666666666666666666666666667
ADVDEC1 = ADVDEC0 +50
//PLOT SIMPLE ADVANCED/ DECLINE DOW JONES
plot(ADVDEC1, "ADVDEC.DJ", color = color.rgb(0, 0, 0, 90), linewidth = 2) 





//Horizontal Line at 30 = MAX BULL LINE 
hline(100, "MAX", color.black, linestyle = hline.style_dashed, linewidth = 2)

//Horizontal Line at 30 = MAX BEAR LINE 
hline(0, "MIN", color.black, linestyle = hline.style_dashed, linewidth = 2)

//Horizontal Line at 30 = Neutral 

hline(60, "60Neutral", color.black, linestyle = hline.style_dashed, linewidth = 1)
hline(50, "50Neutral", color.black, linestyle = hline.style_dotted, linewidth = 1)
hline(40, "40Neutral", color.black, linestyle = hline.style_dashed, linewidth = 1)

