//+------------------------------------------------------------------+
//|                                                          x y.mq4 |
//|                                                           .....h |
//|                                                    hayseedfx.com |
//+------------------------------------------------------------------+
#property copyright ".....h"
#property link      "hayseedfx.com"

#property indicator_chart_window

extern int x = 1015;
extern int y = 0;
extern int perpip = 1;
extern int stoppips = 200;
extern int percent = 5;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
    Display("percentatstoppips", x,y);
    ObjectSetText ("percentatstoppips", stoppips + " pips at " + percent + "%", 12, "Verdana", Lime);    
    
    Display("accbal", x,y+20);
    ObjectSetText ("accbal", "= " + DoubleToStr(AccountBalance()*0.001*percent/stoppips/(MarketInfo(Symbol(), MODE_TICKVALUE)),3), 12, "Verdana", Lime);
//----
   return(0);
  }
//+------------------------------------------------------------------+

void Display(string name, int x, int y)
   {
   ObjectCreate(name, OBJ_LABEL, 0, 0, 0);
   ObjectSet(name, OBJPROP_CORNER, 0);
   ObjectSet(name, OBJPROP_XDISTANCE, x);
   ObjectSet(name, OBJPROP_YDISTANCE, y);
   ObjectSet(name, OBJPROP_BACK, FALSE);
   } 