MA plot script