Custom Watchlist Help

W

waltj

New member
Hey all,

Ive been playing around with custom watchlists here lately.

my question is why are some of these labels correct and others not.

Was thinking if I have a cross down then it should be red, but not the case in all



Below is the code im using

Thanks yall

Code:
def EMA4 = ExpAverage(close, 4);
def EMA8 = ExpAverage(close, 8);
def EMA13 = ExpAverage(close, 13);
def EMA50 = ExpAverage(close, 50);

def bullish = EMA4 crosses above EMA13 within 3 bars;

def bearish = EMA4 crosses below EMA13 within 3 bars;

AddLabel(bullish, "Cross Up", color.black);
AddLabel(bearish, "Cross Down", color.black);
AddLabel(!bullish and !bearish, " ", color.black);

AssignBackgroundColor(if bullish then color.green else if bearish then color.red else color.black);
 
W

waltj

New member
I think it may be my look back period. Roku for instance DID cross down 3 bars ago, but has since crossed back up.

This may be why i have a cross down label with a green background.



If someone can confirm this, that would be great

Thanks again yall
 
BenTen

BenTen

Administrative
Staff
VIP
You need to check for the lookback period and the timeframe that the watchlist is using.
 

Similar threads

Top