Try this. Ive just removed the usual"delete" error.
It works fine with a few warnings.
Dont expect miracles!

RSI Envelopes EA_updated.mq4