@Ahmar824 then
/USER] says, "Your Wish is my command." 🤣
[/QUOTE]
[USER=6343]@cos251[
i was trying to make this one with 5 zones, can you guy check what im missing
Thank you
declare upper;
declare once_per_bar;
input showEMACloud = Yes;
input audibleAlerts = Yes;
def StartTime = 0930;
def Update1 = 0930;
def Update2 = 1600;
def EndTime = 1600;
DefineGlobalColor("Zone1", CreateColor(182, 242, 198));
DefineGlobalColor("Zone2", CreateColor(252, 220, 101));
DefineGlobalColor("Zone3", CreateColor(204, 204, 198));
def ema1low = 5;
def ema1high = 13;
def ema2low = 34;
def ema2high = 51;
def ema3low = 72;
def ema3high = 89;
def ema5 = if showEMACloud then ExpAverage(close, ema1low) else Double.NaN;
def ema13 = if showEMACloud then ExpAverage(close, ema1high) else Double.NaN;
def ema34 = if showEMACloud then ExpAverage(close, ema2low) else Double.NaN;
def ema51 = if showEMACloud then ExpAverage(close, ema2high) else Double.NaN;
def ema72 = if showEMACloud then ExpAverage(close, ema3low) else Double.NaN;
def ema89 = if showEMACloud then ExpAverage(close, ema3high) else Double.NaN;
AddCloud( ema5, ema13, Color.DARK_GREEN, Color.RED);
AddCloud(ema34, ema51, Color.GREEN, Color.VIOLET);
AddCloud(ema72, ema89, Color.BLUE, Color.YELLOW);
def CrossAbove = if showEMACloud and ema5 > ema13 and ema5[1] <= ema13[1] then 1 else 0;
def CrossBelow = if showEMACloud and ema5 < ema13 and ema5[1] >= ema13[1] then 1 else 0;
Alert(showEMACloud and audibleAlerts and CrossAbove, "Buy", Alert.BAR, Sound.Ding);
Alert(showEMACloud and audibleAlerts and CrossBelow, "Sell", Alert.BAR, Sound.Ring);
################################################################
########## Booleans Set for Plot Use #########
################################################################
def afterStart;
def beforeEnd;
def today;
def openPrice;
if GetAggregationPeriod() <= AggregationPeriod.day {
afterStart = GetTime() > RegularTradingStart(GetYYYYMMDD());
beforeEnd = GetTime() < RegularTradingEnd(GetYYYYMMDD());
today = if GetLastDay() == GetDay() then 1 else Double.NaN;
openPrice = DailyOpen();
} else {
afterStart = Double.NaN;
beforeEnd = Double.NaN;
today = Double.NaN;
openPrice = Double.NaN;
}
plot DailyO = if openPrice then openPrice else Double.NaN;
script Zone {
def H ;
def L ;
def V ;
input CountIn = 0930;
input CountOut = 1600;
def TF = SecondsFromTime(CountIn) >= 0 and SecondsTillTime(CountOut) >= 0;
if TF and !TF[1] {
H = high;
L = low;
V = volume;
} else if TF and volume > V[1] {
H = high;
L = low;
V = volume;
} else {
H = H[1];
L = L[1];
V = V[1];
}
plot VZH = H;
plot VZL = L;
VZH.Hide();
VZL.Hide();
}
def Z1H = Zone(CountIn = StartTime, CountOut = Update1).VZH;
def Z2H = Zone(CountIn = Update1, CountOut = Update2).VZH;
def Z3H = Zone(CountIn = Update1, CountOut = Update3).VZH;
def Z4H = Zone(CountIn = Update1, CountOut = Update4).VZH;
def Z5H = Zone(CountIn = Update2, CountOut = EndTime).VZH;
def Z1L = Zone(CountIn = StartTime, CountOut = Update1).VZL;
def Z2L = Zone(CountIn = Update1, CountOut = Update2).VZL;
def Z3L = Zone(CountIn = Update1, CountOut = Update3).VZL;
def Z4L = Zone(CountIn = Update1, CountOut = Update4).VZL;
def Z5L = Zone(CountIn = Update2, CountOut = EndTime).VZL;
def BelowVZ = if close < Z1L then 1 else 0;
def AboveVZ = if close > Z1H or close > Z2H or close > Z3H or close > Z4H or close > Z5H then 1 else 0;
AddCloud(if afterStart and beforeEnd then Z1H else Double.NaN, if afterStart and beforeEnd then Z1L else Double.NaN, GlobalColor("Zone1"), GlobalColor("Zone1"));
AddCloud(if Update1 and beforeEnd then Z2H else Double.NaN, if Update1 and beforeEnd then Z2L else Double.NaN, GlobalColor("Zone2"), GlobalColor("Zone2"));
AddCloud(if Update2 and beforeEnd then Z3H else Double.NaN, if Update2 and beforeEnd then Z3L else Double.NaN, GlobalColor("Zone3"), GlobalColor("Zone3"));
Alert(audibleAlerts and AboveVZ, "Above High VolumeBar Caution Long", Alert.BAR, Sound.Ding);
Alert(audibleAlerts and BelowVZ, "Below High VolumeBar Look for Reversal", Alert.BAR, Sound.Ring);[/USER]