//+------------------------------------------------------------------+
//|                                                 +Market_Info.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#property indicator_chart_window
extern double lot=0.1;
int to,tc;double mno=1;string val;
//+------------------------------------------------------------------+
void deinit(){Comment(" ");return;}
//+------------------------------------------------------------------+
void start(){
   val=AccountCurrency();
   if(Digits==3||Digits==5){mno=0.1;}else{mno=1;}
   for(int i=0;i<25;i++){if(Time[i]-Time[i+1]>Period()*60){to=Time[i];tc=Time[i+1];break;}}
   double profit;
   for(i=0;i<OrdersTotal();i++){
     if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
       if(OrderSymbol()==Symbol()){
         profit=profit+OrderProfit()+OrderSwap()+OrderCommission();
       }
     }
   }
   if(MarketInfo(Symbol(),MODE_TRADEALLOWED)==0){
     string makt = "Market Close";
   }else{
     makt = "Market Open";
   }
   Comment("For present lot = ",lot,"\n",
           "Tick value = ",MarketInfo(Symbol(),MODE_TICKVALUE)*lot*mno,"  ",val,"\n",
           "Spread = ",MarketInfo(Symbol(),MODE_SPREAD)*mno," pips  ",MarketInfo(Symbol(),MODE_SPREAD)*MarketInfo(Symbol(),MODE_TICKVALUE)*lot*mno,"  ",val,"\n",
           "Stoplewel = ",MarketInfo(Symbol(),MODE_STOPLEVEL)*mno," pips  ",MarketInfo(Symbol(),MODE_STOPLEVEL)*MarketInfo(Symbol(),MODE_TICKVALUE)*lot*mno,"  ",val,"\n",
           "Freezlewel = ",MarketInfo(Symbol(),MODE_FREEZELEVEL)*mno,"\n",
           "Swaplong = ",MarketInfo(Symbol(),MODE_SWAPLONG)*lot*mno,"  ",val,"\n",
           "SwapShort = ",MarketInfo(Symbol(),MODE_SWAPSHORT)*lot*mno,"  ",val
           ,"\nLeverage = ",AccountLeverage()
           ,"\nMargin = ",MarketInfo(Symbol(),MODE_MARGINREQUIRED)*lot*mno,"  ",val
           ,"\nMargin = ",MarketInfo(Symbol(),MODE_MARGINMAINTENANCE)*lot*mno,"  ",val
           ,"\nStartSession = ",TimeToStr(to,TIME_MINUTES)
           ,"\nEndSession = ",TimeToStr(tc,TIME_MINUTES)
           ,"\nMin Lot = ",MarketInfo(Symbol(),MODE_MINLOT)
           ,"\nProfit = ",profit,"  ",val
           ,"\n",makt 
           );

return;}

