Hi Folks!
Such a rich community here, I figure I should just ask the wizards...Can someone tell me why this script is producing bizarre results?
Bizarre in that I get alerts on strong_BullishCondition and less than a minute later, I can get an update saying strong_BearishCondition. This is on a 3m /ES chart. What's going on here?
THANKS!!!
def myVWAP = VWAP();
def strong_BullishCondition = if volume > volume[1] and close > myVWAP and close > close[1]
then yes
else no;
def weak_BullishCondition = if volume > volume[1] and ( close > myVWAP or close > close[1] )
then yes
else no;
def weak_BearishCondition = if volume < volume[1] and ( close < myVWAP or close < close[1] )
then yes
else no;
def strong_BearishCondition = if volume < volume[1] and close < myVWAP and close < close[1]
then yes
else no;
AddLabel(yes,"VOLUME", if strong_bullishCondition then color.green else if weak_BullishCondition then color.dark_green else if weak_bearishCondition then color.dark_red else if strong_BearishCondition then color.red else color.gray);
Alert(strong_bullishCondition, "ES Strong VOLUME UP", Alert.BAR, Sound.Ding);
Alert(strong_BearishCondition, "ES Strong VOLUME DOWN", Alert.BAR, Sound.Ding);
Such a rich community here, I figure I should just ask the wizards...Can someone tell me why this script is producing bizarre results?
Bizarre in that I get alerts on strong_BullishCondition and less than a minute later, I can get an update saying strong_BearishCondition. This is on a 3m /ES chart. What's going on here?
THANKS!!!
def myVWAP = VWAP();
def strong_BullishCondition = if volume > volume[1] and close > myVWAP and close > close[1]
then yes
else no;
def weak_BullishCondition = if volume > volume[1] and ( close > myVWAP or close > close[1] )
then yes
else no;
def weak_BearishCondition = if volume < volume[1] and ( close < myVWAP or close < close[1] )
then yes
else no;
def strong_BearishCondition = if volume < volume[1] and close < myVWAP and close < close[1]
then yes
else no;
AddLabel(yes,"VOLUME", if strong_bullishCondition then color.green else if weak_BullishCondition then color.dark_green else if weak_bearishCondition then color.dark_red else if strong_BearishCondition then color.red else color.gray);
Alert(strong_bullishCondition, "ES Strong VOLUME UP", Alert.BAR, Sound.Ding);
Alert(strong_BearishCondition, "ES Strong VOLUME DOWN", Alert.BAR, Sound.Ding);