//+------------------------------------------------------------------+ //| alert.mq4 | //| freecbc3 | //| https://www.mql5.com/en/forum/341397 | //+------------------------------------------------------------------+ #property copyright "freecbc3" #property link "https://www.mql5.com/en/forum/341397" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { if (iClose(NULL,0,1) > iOpen(NULL,0,1)) Alert("Buy"); else if (iClose(NULL,0,1) < iOpen(NULL,0,1)) Alert("Sell"); } //+------------------------------------------------------------------+