# MTF Moving Average Cloud Scan Day (For Scan Only)
declare lower;
input length = 10;
input agperiod1 = {"1 min", "2 min", "5 min", "10 min", "15 min", "30 min", "1 hour", "4 hours", default "Day", "Week"};
#input agperiod2 = {"1 min", "2 min", "5 min", "10 min", "15 min", "30 min", "1 hour", "4 hours", "Day", default "Week"};
plot avg1 = ExpAverage(close(period = agperiod1), length);
def height = avg1 - avg1[length];
avg1.SetStyle(Curve.SHORT_DASH);
avg1.SetLineWeight(1);
#avg.SetDefaultColor(Color.Gray);
plot UP1 = avg1[1] < avg1;
def DOWN1 = avg1[1] > avg1;
Avg1.AssignValueColor(if UP1 then Color.LIGHT_GREEN else if DOWN1 then Color.RED else Color.YELLOW);
#plot avg2 = ExpAverage(close(period = agperiod2), length);
#def height2 = avg2 - avg2[length];
#avg2.SetStyle(Curve.SHORT_DASH);
#avg2.SetLineWeight(1);
#avg.SetDefaultColor(Color.Gray);
#def UP2 = avg2[1] < avg2;
#def DOWN2 = avg2[1] > avg2;
#Avg2.AssignValueColor(if UP2 then Color.LIGHT_GREEN else if DOWN2 then Color.RED else Color.YELLOW);
plot price1 = close;
def UP3 = price1[1] < price1;
def DOWN3 = price1[1] > price1;
price1.AssignValueColor(if UP3 then Color.LIGHT_GREEN else if DOWN3 then Color.RED else Color.YELLOW);
#AddCloud(avg2, avg1, Color.LIGHT_RED, Color.CURRENT);
#AddCloud(avg1, avg2, Color.LIGHT_GREEN, Color.CURRENT);