//+------------------------------------------------------------------+
//|                               Copyright © 2011, Хлыстов Владимир |
//|                                                cmillion@narod.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, http://cmillion.narod.ru"
#property link      "cmillion@narod.ru"
//----
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Aqua
#property indicator_style1 0
#property indicator_level1 0
#property indicator_levelcolor DimGray

double FreeMarginProfit[];

int BatTime;
//+------------------------------------------------------------------+
int init()
{
   IndicatorBuffers(1);
   SetIndexBuffer(0, FreeMarginProfit);

   SetIndexLabel(0, "Profit");
   IndicatorDigits(2);
   return(0);
}
//+------------------------------------------------------------------+
int start()
{
   FreeMarginProfit[0] = AccountProfit();
   
   if (BatTime==Time[0]) return;
   BatTime=Time[0];
   
   for(int i = Bars-1; i > 0; i--)
   {
      FreeMarginProfit[i]     = FreeMarginProfit[i-1];

   }
   
   return(0);
  }
//+------------------------------------------------------------------+