input price = close;
input displace = 0;
input length1 = 50;
input length2 = 55;
input length3 = 20;
input length4 = 21;
input period = AggregationPeriod.DAY;
input averageType = AverageType.Exponential;
def MA1 = MovingAverage(averageType, close(period = period) [-displace], length = length1);
def MA2 = MovingAverage(averageType, close(period = period) [-displace], length = length2);
def MA3 = MovingAverage(averageType, close(period = period) [-displace], length = length3);
def MA4 = MovingAverage(averageType, close(period = period) [-displace], length = length4);
#AddCloud(ma1,ma2, (CreateColor(255, 240, 0)));
#AddCloud(ma3,ma4, (CreateColor(100, 240, 0)));
addcloud(ma1,ma2, color.yellow, color.dark_orange);
addcloud(ma3,ma4, color.green, color.red);