//+------------------------------------------------------------------+
//|                                             Account_Leverage.mq4 |
//+------------------------------------------------------------------+

#property strict
#property indicator_chart_window

extern string  Text = "Leverage: ";
extern string  Font = "Arial";
extern int     FontSize = 12;
extern color   Fontcolor=clrDodgerBlue;
input ENUM_BASE_CORNER corner=CORNER_RIGHT_UPPER;
extern int     XDISTANCE=5; 
extern int     YDISTANCE=20;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
  int OnInit()
  {

 return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Deinit                   
//+------------------------------------------------------------------+
  int deinit()
  {
  ObjectDelete("Account Leverage");
  return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
  int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {

  ObjectCreate ("Account Leverage", OBJ_LABEL,0,0,0);
  ObjectSet ("Account Leverage", OBJPROP_CORNER,corner);
  ObjectSet ("Account Leverage", OBJPROP_XDISTANCE,XDISTANCE);
  ObjectSet ("Account Leverage", OBJPROP_YDISTANCE,YDISTANCE);
  ObjectSetText("Account Leverage",Text+DoubleToStr(AccountLeverage(),0),FontSize,Font,Fontcolor); 

 return(rates_total);
  }
//+------------------------------------------------------------------+


