Add these new features: 1. Add 3rd SMA, 2. hard-code 3rd SMA length for your next interval according to fast MA length(that say if your fast MA length is 24, smaller interval is 5m, and larger one is 30m, then your 3rd SMA length should be 6 * fast length(24)= 144). If your use different intervals, just do some minor adjust line between 13 and 18.