/**
 * TestIndicator
 */
#property indicator_chart_window


/**
 * Main function
 *
 * @return int - error code
 */
int start() {

   double tickSize        = MarketInfo(Symbol(), MODE_TICKSIZE      );
   double tickValue       = MarketInfo(Symbol(), MODE_TICKVALUE     );
   double marginRequired  = MarketInfo(Symbol(), MODE_MARGINREQUIRED);
   double lotValue        = Close[0]/tickSize * tickValue;
   double leverage        = lotValue/marginRequired;
   int    accountLeverage = AccountLeverage();

   Comment("\n\n"
          +"Margin required:     "+ DoubleToStr(marginRequired, 2) +" "+ AccountCurrency() +"  (1:"+ DoubleToStr(MathRound(leverage), 0) +")\n"
          +"Account leverage:  1:"+ accountLeverage);

   return(0);
}
