//+------------------------------------------------------------------+
//|                         ! MTH mt4 b600 General Info v01 Indi.mq4 |
//|                                      Copyright © 2014: MTH_Depok |
//|                                         do your homework mate... |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2014: MTH_Depok b600"
#property link      "do your homework mate..."
#property version   "1.00"
//#property strict
#property indicator_chart_window
//==== External Parameters ====
extern string  ID                   ="01";
extern int     IndiWindows          =0;
extern int     WindowCorner         =1;
extern string  ChartType            ="Renko";
extern bool    ShowData             =true;
extern bool    ShowAccountData      =false;
extern double  StartDeposit         =1000;
extern double  LotPercentage        =1;
extern string  HeaderFontName       ="Arial Narrow Bold";
extern color   HeaderFontColor      =Blue;
extern string  FontName             ="Arial Narrow Bold";
extern int     FontSize             =11;
extern color   FontColor            =DarkBlue;
extern color   NetColor             =Blue;
extern color   PosColor             =DarkGreen;
extern color   NegColor             =Crimson;
extern int     Xpos                 =160;
extern int     Xstep                =70;
extern int     Ypos                 =10;
extern int     Ystep                =13;
//==== Internal Parameters ====
double   Curr_Equity;
double   Prev_Equity;
double   Curr_Balance;
double   Lot_Limit;
double   Max_Lots;
double   Min_Lots;
double   Stp_Lots;
double   Point_Value;
color    StatColor,BidColor,AskColor;
double   Curr_PL;
string   PL_pct;
double   PL_pctval;
double   Lot_Margin;
string   MyPeriod;
double   Symb_Spread;
int      Acc_Lev;
int      SymX,SymY,SymFontSize;
string   BrickSize;
string   BrickShift;
bool     AltChart=false;
double   MyBid,PrevBid,CurrBid;
double   MyAsk,PrevAsk,CurrAsk;
int      MyDigits;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   switch   (Period())
            {
            case 1      :  MyPeriod="M1"  ;break;
            case 5      :  MyPeriod="M5"  ;break;
            case 15     :  MyPeriod="M15" ;break;
            case 30     :  MyPeriod="M30" ;break;
            case 60     :  MyPeriod="H1"  ;break;
            case 240    :  MyPeriod="H4"  ;break;
            case 1440   :  MyPeriod="D1"  ;break;
            case 10080  :  MyPeriod="W1"  ;break;
            case 43200  :  MyPeriod="MN"  ;break;
            default     :  MyPeriod="M"+Period();AltChart=true;break;
            }
   if       (WindowCorner==0 || WindowCorner==1)
            {
            if       (AltChart)  
                     {SymX=Xpos;SymY=Ypos;Ypos=Ypos+Ystep*6;SymFontSize=FontSize+3;}
            else if  (!AltChart) 
                     {SymX=Xpos;SymY=Ypos;Ypos=Ypos+Ystep*4;SymFontSize=FontSize+3;}
            }
   else if  (WindowCorner==2 || WindowCorner==3)
            {
            if       (AltChart)  
                     {SymX=Xpos;SymY=Ypos+Ystep*8+5;SymFontSize=FontSize+3;}
            else if  (!AltChart) 
                     {SymX=Xpos;SymY=Ypos+Ystep*8;SymFontSize=FontSize+3;}
            }
//----
   MyDigits =MarketInfo(Symbol(),MODE_DIGITS);
   PrevBid  =MarketInfo(Symbol(),MODE_BID);
   PrevAsk  =MarketInfo(Symbol(),MODE_ASK);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       
//+------------------------------------------------------------------+
int deinit()
  {
   int   obj_total= ObjectsTotal();
   for   (int i= obj_total; i>=0; i--) 
         {
         string obj_name= ObjectName(i);
         if (StringSubstr(obj_name,0,2)==StringSubstr(ID,0,2)) 
            ObjectDelete(obj_name);
         }
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   MyBid    =NormalizeDouble(MarketInfo(Symbol(),MODE_BID),MyDigits);
   MyAsk    =NormalizeDouble(MarketInfo(Symbol(),MODE_ASK),MyDigits);
   
   if       (MyBid>CurrBid)   {BidColor=PosColor;PrevBid=CurrBid;CurrBid=MyBid;}
   else if  (MyBid<CurrBid)   {BidColor=NegColor;PrevBid=CurrBid;CurrBid=MyBid;}
   else if  (MyBid==PrevBid)  {BidColor=FontColor;PrevBid=PrevBid;CurrBid=CurrBid;}
   
   if       (MyAsk>CurrAsk)   {AskColor=PosColor;PrevAsk=CurrAsk;CurrAsk=MyAsk;}
   else if  (MyAsk<CurrAsk)   {AskColor=NegColor;PrevAsk=CurrAsk;CurrAsk=MyAsk;}
   else if  (MyAsk==PrevAsk)  {AskColor=FontColor;PrevAsk=PrevAsk;CurrAsk=CurrAsk;}
                  
//----      
   //Header Symbol Chart Text
   if    (!AltChart) 
         {
         ChartType="Candle";
         if    (WindowCorner==0)
               {
               DrawText(ID,"Tx_Symbol"    ,WindowCorner  ,SymX       ,SymY+2        ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX+120   ,SymY+Ystep*2  ,"B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX       ,SymY+Ystep*2  ,"A: "+DoubleToStr(MyAsk,MyDigits)+" / ",SymFontSize+1,HeaderFontName,AskColor);      
               }
         if    (WindowCorner==1)
               {
               DrawText(ID,"Tx_Symbol"    ,WindowCorner  ,SymX       ,SymY+2        ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX       ,SymY+Ystep*2  ," / B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX+120   ,SymY+Ystep*2  ,"A: "+DoubleToStr(MyAsk,MyDigits),SymFontSize+1,HeaderFontName,AskColor);      
               }
         if    (WindowCorner==2)
               {
               DrawText(ID,"Tx_Symbol"    ,WindowCorner  ,SymX       ,SymY+Ystep*2  ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX+120   ,SymY          ,"B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX       ,SymY          ,"A: "+DoubleToStr(MyAsk,MyDigits)+" / Ask:",SymFontSize+1,HeaderFontName,AskColor);      
               }      
         if    (WindowCorner==3)
               {
               DrawText(ID,"Tx_Symbol"    ,WindowCorner  ,SymX       ,SymY+Ystep*2  ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX       ,SymY          ," / B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX+120   ,SymY          ,"A: "+DoubleToStr(MyAsk,MyDigits),SymFontSize+1,HeaderFontName,AskColor);      
               }      
         
         }
   if    (AltChart)  
         {
         BrickSize   =DoubleToStr(MathAbs(Open[1]-Close[1])/Point/10,2);
         BrickShift  =DoubleToStr((MathAbs((Open[2]+Close[2])/2-(Open[1]+Close[1])/2)/Point/10)/(MathAbs(Open[1]-Close[1])/Point/10)*100,2);      
         
         if    (WindowCorner==0)
               {
               DrawText(ID,"Tx_Symbol1"   ,WindowCorner  ,SymX       ,SymY          ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_Symbol2"   ,WindowCorner  ,SymX       ,SymY+Ystep*2  ,BrickSize+" Point, Shifted "+BrickShift+" %",SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX+120   ,SymY+Ystep*4  ,"B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX       ,SymY+Ystep*4  ,"A: "+DoubleToStr(MyAsk,MyDigits)+" / ",SymFontSize+1,HeaderFontName,AskColor);      
               }
         if    (WindowCorner==1)
               {
               DrawText(ID,"Tx_Symbol1"   ,WindowCorner  ,SymX       ,SymY          ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_Symbol2"   ,WindowCorner  ,SymX       ,SymY+Ystep*2  ,BrickSize+" Point, Shifted "+BrickShift+" %",SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX       ,SymY+Ystep*4  ," / B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX+120   ,SymY+Ystep*4  ,"A: "+DoubleToStr(MyAsk,MyDigits),SymFontSize+1,HeaderFontName,AskColor);      
               }
         if    (WindowCorner==2)
               {
               DrawText(ID,"Tx_Symbol1"   ,WindowCorner  ,SymX       ,SymY+Ystep*4  ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_Symbol2"   ,WindowCorner  ,SymX       ,SymY+Ystep*2  ,BrickSize+" Point, Shifted "+BrickShift+" %",SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX+120   ,SymY          ,"B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX       ,SymY          ,"A: "+DoubleToStr(MyAsk,MyDigits)+" / ",SymFontSize+1,HeaderFontName,AskColor);      
               }
         if    (WindowCorner==3)
               {
               DrawText(ID,"Tx_Symbol1"   ,WindowCorner  ,SymX       ,SymY+Ystep*4  ,Symbol()+" "+ChartType+" "+MyPeriod,SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_Symbol2"   ,WindowCorner  ,SymX       ,SymY+Ystep*2  ,BrickSize+" Point, Shifted "+BrickShift+" %",SymFontSize,HeaderFontName,HeaderFontColor);      
               DrawText(ID,"Tx_PriceBid"  ,WindowCorner  ,SymX       ,SymY          ," / B: "+DoubleToStr(MyBid,MyDigits),SymFontSize+1,HeaderFontName,BidColor);      
               DrawText(ID,"Tx_PriceAsk"  ,WindowCorner  ,SymX+120   ,SymY          ,"A: "+DoubleToStr(MyAsk,MyDigits),SymFontSize+1,HeaderFontName,AskColor);      
               }
         }
   if (ShowData && ShowAccountData && (WindowCorner==0 || WindowCorner==1))
   {
   //Symbol Data==============================================================
   Lot_Margin=MarketInfo(Symbol(),MODE_MARGINREQUIRED);
   DrawText(ID,"Tx_LotMargin",   WindowCorner,Xpos          ,Ypos          ,"Margin/Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotMargin",   WindowCorner,Xpos+Xstep*1  ,Ypos          ,"$."+DoubleToStr(Lot_Margin,2),FontSize,FontName,PosColor);
   
   Max_Lots=MathFloor(AccountFreeMargin()/Lot_Margin);
   DrawText(ID,"Tx_MaxLot",      WindowCorner,Xpos          ,Ypos+Ystep*1  ,"Free Lots",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Maxlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*1  ,DoubleToStr(Max_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Min_Lots=MarketInfo(Symbol(),MODE_MINLOT);
   DrawText(ID,"Tx_MinLot",      WindowCorner,Xpos          ,Ypos+Ystep*2  ,"Min Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Minlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*2  ,DoubleToStr(Min_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Lot_Limit=MarketInfo(Symbol(),MODE_MAXLOT);
   DrawText(ID,"Tx_LotLimit",    WindowCorner,Xpos          ,Ypos+Ystep*3  ,"Max Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotLimit",    WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*3  ,DoubleToStr(Lot_Limit,2),FontSize,FontName,HeaderFontColor);
   
   Stp_Lots=MarketInfo(Symbol(),MODE_LOTSTEP);
   DrawText(ID,"Tx_LotStep",     WindowCorner,Xpos          ,Ypos+Ystep*4  ,"Lot Step",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotStep",     WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*4  ,DoubleToStr(Stp_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Point_Value=MarketInfo(Symbol(),MODE_TICKVALUE)*10;
   DrawText(ID,"Tx_PointValue",  WindowCorner,Xpos          ,Ypos+Ystep*5  ,"Point/Lot $",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_PointValue",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*5  ,"$."+DoubleToStr(Point_Value,2),FontSize,FontName,HeaderFontColor);
   
   Symb_Spread=MarketInfo(Symbol(),MODE_SPREAD)/10;
   DrawText(ID,"Tx_SymbSpread",  WindowCorner,Xpos          ,Ypos+Ystep*6  ,"Spread",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_SymbSpread",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*6  ,DoubleToStr(Symb_Spread,1)+" Point",FontSize,FontName,HeaderFontColor);
   
   Acc_Lev=AccountLeverage();
   DrawText(ID,"Tx_AccLev",      WindowCorner,Xpos          ,Ypos+Ystep*7  ,"Leverage",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_AccLev",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*7  ,"1 : "+Acc_Lev,FontSize,FontName,HeaderFontColor);
   
   //General Account Data============================================================
   DrawText(ID,"Tx_Margin",      WindowCorner,Xpos+Xstep*2-5,Ypos          ,"Margin Used",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Margin",      WindowCorner,Xpos+Xstep*3  ,Ypos          ,"$."+DoubleToStr(AccountMargin(),2),FontSize,FontName,PosColor);
   
   if    (AccountFreeMargin()<0) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_FreeMargin",  WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*1  ,"Free Margin",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_FreeMargin",  WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*1  ,"$."+DoubleToStr(AccountFreeMargin(),2),FontSize,FontName,StatColor);

   DrawText(ID,"Tx_StartDeposit",WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*2  ,"Deposit",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_StartDeposit",WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*2  ,"$."+DoubleToStr(StartDeposit,2),FontSize,FontName,PosColor);
   
   if    (AccountEquity()<StartDeposit) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_CurrEquity",  WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*3  ,"Equity",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_CurrEquity",  WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*3  ,"$."+DoubleToStr(AccountEquity(),2),FontSize,FontName,StatColor);
   
   if    (AccountBalance()<StartDeposit) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_CurrBalance", WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*4  ,"Balance",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_CurrBalance", WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*4  ,"$."+DoubleToStr(AccountBalance(),2),FontSize,FontName,StatColor);
   
   if    (AccountBalance()>AccountEquity()) StatColor=NegColor; else StatColor=PosColor;
   Curr_PL=AccountEquity()-AccountBalance();
   DrawText(ID,"Tx_CurrPL",      WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*5  ,"P/L $ of B",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_CurrPL",      WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*5  ,"$."+DoubleToStr(Curr_PL,2),FontSize,FontName,StatColor);
   
   PL_pctval=(Curr_PL/StartDeposit)*100;
   if    (Curr_PL<0) PL_pct=DoubleToStr(PL_pctval,2); else PL_pct="+"+DoubleToStr(PL_pctval,2);
   if    (Curr_PL<0) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_PL_pct",      WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*6  ,"P/L % of D",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_PL_pct",      WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*6  ,PL_pct+" %",FontSize,FontName,StatColor);
   } //if (ShowData && ShowAccountData && (WindowCorner==0 || WindowCorner==1))
   
   if (ShowData && !ShowAccountData  && (WindowCorner==0 || WindowCorner==1))
   {
   //Symbol Data==============================================================
   Lot_Margin=MarketInfo(Symbol(),MODE_MARGINREQUIRED);
   DrawText(ID,"Tx_LotMargin",   WindowCorner,Xpos          ,Ypos          ,"Margin/Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotMargin",   WindowCorner,Xpos+Xstep*1  ,Ypos          ,"$."+DoubleToStr(Lot_Margin,2),FontSize,FontName,PosColor);
   
   Max_Lots=MathFloor(AccountFreeMargin()/Lot_Margin);
   DrawText(ID,"Tx_MaxLot",      WindowCorner,Xpos          ,Ypos+Ystep*1  ,"Free Lots",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Maxlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*1  ,DoubleToStr(Max_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Min_Lots=MarketInfo(Symbol(),MODE_MINLOT);
   DrawText(ID,"Tx_MinLot",      WindowCorner,Xpos          ,Ypos+Ystep*2  ,"Min Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Minlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*2  ,DoubleToStr(Min_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Lot_Limit=MarketInfo(Symbol(),MODE_MAXLOT);
   DrawText(ID,"Tx_LotLimit",    WindowCorner,Xpos          ,Ypos+Ystep*3  ,"Max Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotLimit",    WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*3  ,DoubleToStr(Lot_Limit,2),FontSize,FontName,HeaderFontColor);
   
   Stp_Lots=MarketInfo(Symbol(),MODE_LOTSTEP);
   DrawText(ID,"Tx_LotStep",     WindowCorner,Xpos          ,Ypos+Ystep*4  ,"Lot Step",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotStep",     WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*4  ,DoubleToStr(Stp_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Point_Value=MarketInfo(Symbol(),MODE_TICKVALUE)*10;
   DrawText(ID,"Tx_PointValue",  WindowCorner,Xpos          ,Ypos+Ystep*5  ,"Point/Lot $",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_PointValue",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*5  ,"$."+DoubleToStr(Point_Value,2),FontSize,FontName,HeaderFontColor);
   
   Symb_Spread=MarketInfo(Symbol(),MODE_SPREAD)/10;
   DrawText(ID,"Tx_SymbSpread",  WindowCorner,Xpos          ,Ypos+Ystep*6  ,"Spread",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_SymbSpread",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*6  ,DoubleToStr(Symb_Spread,1)+" Point",FontSize,FontName,HeaderFontColor);
   
   Acc_Lev=AccountLeverage();
   DrawText(ID,"Tx_AccLev",      WindowCorner,Xpos          ,Ypos+Ystep*7  ,"Leverage",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_AccLev",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*7  ,"1 : "+Acc_Lev,FontSize,FontName,HeaderFontColor);
   }//if (ShowData && !ShowAccountData  && (WindowCorner==0 || WindowCorner==1))     
//----
if (ShowData && ShowAccountData && (WindowCorner==2 || WindowCorner==3))
   {
   //Symbol Data==============================================================
   Lot_Margin=MarketInfo(Symbol(),MODE_MARGINREQUIRED);
   DrawText(ID,"Tx_LotMargin",   WindowCorner,Xpos          ,Ypos+Ystep*7  ,"Margin/Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotMargin",   WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*7  ,"$."+DoubleToStr(Lot_Margin,2),FontSize,FontName,PosColor);
   
   Max_Lots=MathFloor(AccountFreeMargin()/Lot_Margin);
   DrawText(ID,"Tx_MaxLot",      WindowCorner,Xpos          ,Ypos+Ystep*6  ,"Free Lots",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Maxlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*6  ,DoubleToStr(Max_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Min_Lots=MarketInfo(Symbol(),MODE_MINLOT);
   DrawText(ID,"Tx_MinLot",      WindowCorner,Xpos          ,Ypos+Ystep*5  ,"Min Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Minlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*5  ,DoubleToStr(Min_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Lot_Limit=MarketInfo(Symbol(),MODE_MAXLOT);
   DrawText(ID,"Tx_LotLimit",    WindowCorner,Xpos          ,Ypos+Ystep*4  ,"Max Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotLimit",    WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*4  ,DoubleToStr(Lot_Limit,2),FontSize,FontName,HeaderFontColor);
   
   Stp_Lots=MarketInfo(Symbol(),MODE_LOTSTEP);
   DrawText(ID,"Tx_LotStep",     WindowCorner,Xpos          ,Ypos+Ystep*3  ,"Lot Step",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotStep",     WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*3  ,DoubleToStr(Stp_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Point_Value=MarketInfo(Symbol(),MODE_TICKVALUE)*10;
   DrawText(ID,"Tx_PointValue",  WindowCorner,Xpos          ,Ypos+Ystep*2  ,"Point/Lot $",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_PointValue",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*2  ,"$."+DoubleToStr(Point_Value,2),FontSize,FontName,HeaderFontColor);
   
   Symb_Spread=MarketInfo(Symbol(),MODE_SPREAD)/10;
   DrawText(ID,"Tx_SymbSpread",  WindowCorner,Xpos          ,Ypos+Ystep*1  ,"Spread",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_SymbSpread",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*1  ,DoubleToStr(Symb_Spread,1)+" Point",FontSize,FontName,HeaderFontColor);
   
   Acc_Lev=AccountLeverage();
   DrawText(ID,"Tx_AccLev",      WindowCorner,Xpos          ,Ypos          ,"Leverage",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_AccLev",      WindowCorner,Xpos+Xstep*1  ,Ypos          ,"1 : "+Acc_Lev,FontSize,FontName,HeaderFontColor);
   
   //General Account Data============================================================
   DrawText(ID,"Tx_Margin",      WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*7  ,"Margin Used",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Margin",      WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*7  ,"$."+DoubleToStr(AccountMargin(),2),FontSize,FontName,PosColor);
   
   if    (AccountFreeMargin()<0) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_FreeMargin",  WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*6  ,"Free Margin",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_FreeMargin",  WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*6  ,"$."+DoubleToStr(AccountFreeMargin(),2),FontSize,FontName,StatColor);

   DrawText(ID,"Tx_StartDeposit",WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*5  ,"Deposit",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_StartDeposit",WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*5  ,"$."+DoubleToStr(StartDeposit,2),FontSize,FontName,PosColor);
   
   if    (AccountEquity()<StartDeposit) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_CurrEquity",  WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*4  ,"Equity",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_CurrEquity",  WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*4  ,"$."+DoubleToStr(AccountEquity(),2),FontSize,FontName,StatColor);
   
   if    (AccountBalance()<StartDeposit) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_CurrBalance", WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*3  ,"Balance",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_CurrBalance", WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*3  ,"$."+DoubleToStr(AccountBalance(),2),FontSize,FontName,StatColor);
   
   if    (AccountBalance()>AccountEquity()) StatColor=NegColor; else StatColor=PosColor;
   Curr_PL=AccountEquity()-AccountBalance();
   DrawText(ID,"Tx_CurrPL",      WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*2  ,"P/L $ of B",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_CurrPL",      WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*2  ,"$."+DoubleToStr(Curr_PL,2),FontSize,FontName,StatColor);
   
   PL_pctval=(Curr_PL/StartDeposit)*100;
   if    (Curr_PL<0) PL_pct=DoubleToStr(PL_pctval,2); else PL_pct="+"+DoubleToStr(PL_pctval,2);
   if    (Curr_PL<0) StatColor=NegColor; else StatColor=PosColor;
   DrawText(ID,"Tx_PL_pct",      WindowCorner,Xpos+Xstep*2-5,Ypos+Ystep*1  ,"P/L % of D",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_PL_pct",      WindowCorner,Xpos+Xstep*3  ,Ypos+Ystep*1  ,PL_pct+" %",FontSize,FontName,StatColor);
   } //if (ShowData && ShowAccountData && (WindowCorner==2 || WindowCorner==3))
   
   if (ShowData && !ShowAccountData  && (WindowCorner==2 || WindowCorner==3))
   {
   //Symbol Data==============================================================
   Lot_Margin=MarketInfo(Symbol(),MODE_MARGINREQUIRED);
   DrawText(ID,"Tx_LotMargin",   WindowCorner,Xpos          ,Ypos+Ystep*7  ,"Margin/Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotMargin",   WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*7  ,"$."+DoubleToStr(Lot_Margin,2),FontSize,FontName,PosColor);
   
   Max_Lots=MathFloor(AccountFreeMargin()/Lot_Margin);
   DrawText(ID,"Tx_MaxLot",      WindowCorner,Xpos          ,Ypos+Ystep*6  ,"Free Lots",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Maxlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*6  ,DoubleToStr(Max_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Min_Lots=MarketInfo(Symbol(),MODE_MINLOT);
   DrawText(ID,"Tx_MinLot",      WindowCorner,Xpos          ,Ypos+Ystep*5  ,"Min Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_Minlot",      WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*5  ,DoubleToStr(Min_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Lot_Limit=MarketInfo(Symbol(),MODE_MAXLOT);
   DrawText(ID,"Tx_LotLimit",    WindowCorner,Xpos          ,Ypos+Ystep*4  ,"Max Lot",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotLimit",    WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*4  ,DoubleToStr(Lot_Limit,2),FontSize,FontName,HeaderFontColor);
   
   Stp_Lots=MarketInfo(Symbol(),MODE_LOTSTEP);
   DrawText(ID,"Tx_LotStep",     WindowCorner,Xpos          ,Ypos+Ystep*3  ,"Lot Step",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_LotStep",     WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*3  ,DoubleToStr(Stp_Lots,2),FontSize,FontName,HeaderFontColor);
   
   Point_Value=MarketInfo(Symbol(),MODE_TICKVALUE)*10;
   DrawText(ID,"Tx_PointValue",  WindowCorner,Xpos          ,Ypos+Ystep*2  ,"Point/Lot $",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_PointValue",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*2  ,"$."+DoubleToStr(Point_Value,2),FontSize,FontName,HeaderFontColor);
   
   Symb_Spread=MarketInfo(Symbol(),MODE_SPREAD)/10;
   DrawText(ID,"Tx_SymbSpread",  WindowCorner,Xpos          ,Ypos+Ystep*1  ,"Spread",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_SymbSpread",  WindowCorner,Xpos+Xstep*1  ,Ypos+Ystep*1  ,DoubleToStr(Symb_Spread,1)+" Point",FontSize,FontName,HeaderFontColor);
   
   Acc_Lev=AccountLeverage();
   DrawText(ID,"Tx_AccLev",      WindowCorner,Xpos          ,Ypos          ,"Leverage",FontSize,FontName,FontColor);
   DrawText(ID,"Vl_AccLev",      WindowCorner,Xpos+Xstep*1  ,Ypos          ,"1 : "+Acc_Lev,FontSize,FontName,HeaderFontColor);
   }//if (ShowData && !ShowAccountData  && (WindowCorner==2 || WindowCorner==3))     

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom Functions
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Custom Function:Draw Text Objects
//+------------------------------------------------------------------+
void  DrawText(string IDs,string Name,int Corner,int Xpos1,int Ypos1,string Text,int FontSize1, string FontName1, color TxtColor) 

      {
      
      ObjectDelete   (IDs+Name);
      ObjectCreate   (IDs+Name,OBJ_LABEL,        IndiWindows,0,0);
      ObjectSet      (IDs+Name,OBJPROP_CORNER,   Corner);
      ObjectSet      (IDs+Name,OBJPROP_XDISTANCE,Xpos1);
      ObjectSet      (IDs+Name,OBJPROP_YDISTANCE,Ypos1);
      ObjectSetText  (IDs+Name,Text,FontSize1,FontName1,TxtColor);
      }