Candle closes above grab candle


Category:
0
0

Pete

Could you help me with a grab candle alert.  I would like an alert when the candle closes above or below the grab candles..Could the alert happen after the candle closes..Long call when it crosses above EMA1 and short when it crosses below EMA3…Thanks

declare upper;
declare once_per_bar;
input Author = “www.simplertrading.com”;

plot ema1 = ExpAverage (high, 34);
plot ema2 = ExpAverage (close, 34);
plot ema3 = ExpAverage (low, 34);
ema1.SetDefaultColor(Color.GREEN);
ema1.SetLineWeight(2);
ema2.SetDefaultColor(Color.BLUE);
ema2.SetLineWeight(2);
ema3.SetDefaultColor(Color.RED);
ema3.SetLineWeight(2);
ema1.hideBubble();
ema2.hideBubble();
ema3.hideBubble();

AssignPriceColor(if close > ema1 and open < close then Color.GREEN
else if close > ema1 and open >= close then Color.DARK_GREEN
else if close < ema3 and open < close then Color.RED
else if close < ema3 and open >= close then Color.DARK_RED
else if open < close then Color.CYAN
else if open >= close then Color.BLUE
else Color.BLUE);

Attachments:
Marked as spam
Posted by (Questions: 49, Answers: 42)
Asked on January 9, 2019 11:50 am
106 views
0

There seems to be an error with the code..Its highlighted re in a few places

( at January 10, 2019 3:41 pm)
0

The errors clear up when you ADD the code provided my Forex Trader to the bottom of your code.

( at January 13, 2019 9:27 am)
0
Private answer

Hi Craig,

Please add this code

# Sound alerts

input AudibleAlert = yes;

def CrossUp = close crosses above EMA1 and open >= close ;
def CrossDn = close crosses below EMA3 and open < close ;

Alert(AudibleAlert and CrossUp, Concat(GetSymbolPart(), ” has crossed above the slow moving average.” ), Alert.BAR, Sound.Bell);
Alert(AudibleAlert and CrossDn, Concat(GetSymbolPart(), ” has crossed below the slow moving average.” ), Alert.BAR, Sound.Bell);

Hope it helps.

Atul

Marked as spam
Posted by (Questions: 3, Answers: 4)
Answered on January 10, 2019 1:55 pm