//+------------------------------------------------------------------+
//|                                                   Question21.mq4 |
//|                   Copyright 2017,HOSSEIN AHMADI BINE-Rise Group. |
//|                                        https://www.risegroup.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017,HOSSEIN AHMADI BINE-Rise Group." " Modified by pedram mtf  @pedrammt4  TELEGRAM"
#property link      "https://www.risegroup.com"
#property version   "1.00"
#property strict

input double lot=0.5;



//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   if(  OrdersTotal()==0)
   {
      if(CandleStatus()=="Buy")
      int tiketbuy=OrderSend(Symbol(),OP_BUY,lot,Ask,2,Low[1],Ask+((Ask-Low[1])/2),NULL,124,0,clrAliceBlue);
      if(CandleStatus()=="Sell")
      int tiketsell=OrderSend(Symbol(),OP_SELL,lot,Bid,2,High[1],Bid+((Bid-High[1])/2),NULL,123,0,clrRed);
 
   }


   
  }
//+------------------------------------------------------------------+
string CandleStatus()
{
   if( Close[1]>Open[1])
   return("Buy");
   else if (  Close[1]<Open[1])
   return("Sell");
   else return("NO Signal");

}