#property indicator_chart_window int count; extern bool email = true; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { } //---- return(0); //+------------------------------------------------------------------+ //| MTF Moving Average | //+------------------------------------------------------------------+ int start() { if (count!=iBarShift(NULL,0,0)) { PlaySound("alert.wav"); if (email) SendMail ("Bar Closed", Symbol()); count=iBarShift(NULL,0,0); } }