Ich schreibe kostenlos einen Ratgeber - Seite 80

 
Das war's, die Sache ist erledigt. Der letzte Punkt, der nicht funktioniert, ist die Anzeige des Textes "Earnings Today". Es ist weder auf Russisch noch auf Englisch zu sehen.
Dateien:
 
Vitali_Leto:
Das war's, die Sache ist erledigt. Die letzte Sache, die nicht funktioniert, ist die Anzeige des Textes "Earnings Today". Sowohl auf Russisch als auch auf Englisch nicht sichtbar.

Überprüfen Sie den gesamten Code:

Menu[5]+DoubleToString(GetProfitForDay(0),2)

ÜberallMenu[5] zu haben

 
Maksim Sovenko:

Überprüfen Sie den gesamten Code:

ÜberallMenu[5] zu haben

Überall ist
 
Vitali_Leto:
Es ist überall zu finden

Zeigen Sie den Code an, aber platzieren Sie ihn richtig


 
Was ist der richtige Weg? Tut mir leid, Dummkopf.
 
Vitali_Leto:
Was ist der richtige Weg? Tut mir leid, Dummkopf.

Klicken Sie zuerst auf die Schaltfläche im Bild und fügen Sie dann den Code ein

 
long X=30,Y=80;
bool ChEvM=0,ChFg=0;
string MenuRUS[6]={"Текущие данные","Баланс: ","Эквити: ","Просадка: ","Общий заработок: ","Заработок сегодня: "};
string MenuENG[6]={"Current data","Balance: ","Equity: ","Drawdown: ","Earned: ","EARNEDTODAY: "};
string Menu[6];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   ArrayCopy(Menu,MenuENG,0,0,5);
   ChEvM=ChartGetInteger(0,CHART_EVENT_MOUSE_MOVE);
   ChFg=ChartGetInteger(0,CHART_FOREGROUND);
   ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,1);
   ChartSetInteger(0,CHART_FOREGROUND,0);
   if(ObjectFind(0,"HEAD")==-1)
     {
      ArrayCopy(Menu,MenuENG,0,0,5);
      EditCreate(0,"HEAD",0,X,Y,202,20,0,Menu[0],"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor,false,true);
      EditCreate(0,"BALANCE",0,X,Y+21,202,20,0,Menu[1]+DoubleToString(AccountBalance(),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"EQUITY",0,X,Y+42,202,20,0,Menu[2]+DoubleToString(AccountEquity(),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"DRAWDOWN",0,X,Y+63,202,20,0,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%","Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"EARNED",0,X,Y+84,202,20,0,Menu[4]+DoubleToString(GetProfit(),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"EARNEDTODAY",0,X,Y+105,202,20,0,Menu[5]+DoubleToString(GetProfitForDay(0),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"RUS",0,X+141,Y+105,30,20,0,"RUS","Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"ENG",0,X+172,Y+105,30,20,0,"ENG","Arial",8,ALIGN_CENTER,true,txtcolor,clrGreen,pnlcolor);
      
     }
   else
     {
      if(ObjectGet("RUS",OBJPROP_BGCOLOR)==clrGreen)
        {
         ArrayCopy(Menu,MenuRUS,0,0,5);
        }
      else
        {
         ArrayCopy(Menu,MenuENG,0,0,5);
        }
     }
   EventSetTimer(1);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinit function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   if(reason!=3)
     {
      ObjectDelete(0,"HEAD");
      ObjectDelete(0,"BALANCE");
      ObjectDelete(0,"EQUITY");
      ObjectDelete(0,"DRAWDOWN");
      ObjectDelete(0,"EARNED");
      ObjectDelete(0,"EARNEDTODAY");
      ObjectDelete(0,"RUS");
      ObjectDelete(0,"ENG");
      ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,ChEvM);
      ChartSetInteger(0,CHART_FOREGROUND,ChFg);
      EventKillTimer();
     }
  }
//+------------------------------------------------------------------+
//| Function create object text                                      |
//+------------------------------------------------------------------+
bool EditCreate(const long             chart_ID=0,
                const string           name="Edit",
                const int              sub_window=0,
                const long             x=0,
                const long             y=0,
                const int              width=50,
                const int              height=18,
                const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER,
                const string           text="Text",
                const string           font="Arial",
                const int              font_size=10,
                const ENUM_ALIGN_MODE  align=ALIGN_CENTER,
                const bool             read_only=false,
                const color            clr=clrWhite,
                const color            back_clr=clrWhite,
                const color            border_clr=clrBlue,
                const bool             back=false,
                const bool             selection=false,
                const bool             hidden=true,
                const long             z_order=0)
  {

   ResetLastError();

   if(!ObjectCreate(chart_ID,name,OBJ_EDIT,sub_window,0,0))
     {
      Print(__FUNCTION__,
            "Code ERROR: ",GetLastError());
      return(false);
     }

   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);
   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width);
   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height);
   ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);
   ObjectSetString(chart_ID,name,OBJPROP_FONT,font);
   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size);
   ObjectSetInteger(chart_ID,name,OBJPROP_ALIGN,align);
   ObjectSetInteger(chart_ID,name,OBJPROP_READONLY,read_only);
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
   ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr);
   ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr);
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
   return(true);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   if(AccountProfit()>0)ObjectSetInteger(0,"BALANCE",OBJPROP_BGCOLOR,clrGreen);
   if(AccountProfit()<0)ObjectSetInteger(0,"BALANCE",OBJPROP_BGCOLOR,clrRed);
   if(AccountProfit()==0)ObjectSetInteger(0,"BALANCE",OBJPROP_BGCOLOR,pnlcolor);
   ObjectSetString(0,"BALANCE",OBJPROP_TEXT,Menu[1]+DoubleToString(AccountBalance(),2));
   ObjectSetString(0,"EQUITY",OBJPROP_TEXT,Menu[2]+DoubleToString(AccountEquity(),2));
   ObjectSetString(0,"DRAWDOWN",OBJPROP_TEXT,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%");
   ObjectSetString(0,"EARNED",OBJPROP_TEXT,Menu[4]+DoubleToString(GetProfit(),2));
   ObjectSetString(0,"EARNEDTODAY",OBJPROP_TEXT,Menu[5]+DoubleToString(GetProfitForDay(0),2));
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   if(id==CHARTEVENT_MOUSE_MOVE && sparam=="1")
     {
      X=ObjectGetInteger(0,"HEAD",OBJPROP_XDISTANCE);
      Y=ObjectGetInteger(0,"HEAD",OBJPROP_YDISTANCE);
      ObjectSetInteger(0,"BALANCE",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"BALANCE",OBJPROP_YDISTANCE,Y+21);
      ObjectSetInteger(0,"EQUITY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EQUITY",OBJPROP_YDISTANCE,Y+42);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_YDISTANCE,Y+63);
      ObjectSetInteger(0,"EARNED",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNED",OBJPROP_YDISTANCE,Y+84);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"RUS",OBJPROP_XDISTANCE,X+141);
      ObjectSetInteger(0,"RUS",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"ENG",OBJPROP_XDISTANCE,X+172);
      ObjectSetInteger(0,"ENG",OBJPROP_YDISTANCE,Y+105);
     }
   if(id==CHARTEVENT_OBJECT_CLICK && sparam=="HEAD")
     {
      X=ObjectGetInteger(0,"HEAD",OBJPROP_XDISTANCE);
      Y=ObjectGetInteger(0,"HEAD",OBJPROP_YDISTANCE);
      ObjectSetInteger(0,"BALANCE",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"BALANCE",OBJPROP_YDISTANCE,Y+21);
      ObjectSetInteger(0,"EQUITY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EQUITY",OBJPROP_YDISTANCE,Y+42);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_YDISTANCE,Y+63);
      ObjectSetInteger(0,"EARNED",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNED",OBJPROP_YDISTANCE,Y+84);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"RUS",OBJPROP_XDISTANCE,X+141);
      ObjectSetInteger(0,"RUS",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"ENG",OBJPROP_XDISTANCE,X+172);
      ObjectSetInteger(0,"ENG",OBJPROP_YDISTANCE,Y+105);
     }
   if(id==CHARTEVENT_OBJECT_CLICK && sparam=="RUS")
     {
      ArrayCopy(Menu,MenuRUS,0,0,5);
      ObjectSetString(0,"HEAD",OBJPROP_TEXT,Menu[0]);
      ObjectSetString(0,"BALANCE",OBJPROP_TEXT,Menu[1]+DoubleToString(AccountBalance(),2));
      ObjectSetString(0,"EQUITY",OBJPROP_TEXT,Menu[2]+DoubleToString(AccountEquity(),2));
      ObjectSetString(0,"DRAWDOWN",OBJPROP_TEXT,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%");
      ObjectSetString(0,"EARNED",OBJPROP_TEXT,Menu[4]+DoubleToString(GetProfit(),2));
      ObjectSetString(0,"EARNEDTODAY",OBJPROP_TEXT,Menu[5]+DoubleToString(GetProfitForDay(0),2));
      ObjectSetInteger(0,"ENG",OBJPROP_BGCOLOR,pnlcolor);
      ObjectSetInteger(0,"RUS",OBJPROP_BGCOLOR,clrGreen);
     }
   if(id==CHARTEVENT_OBJECT_CLICK && sparam=="ENG")
     {
      ArrayCopy(Menu,MenuENG,0,0,5);
      ObjectSetString(0,"HEAD",OBJPROP_TEXT,Menu[0]);
      ObjectSetString(0,"BALANCE",OBJPROP_TEXT,Menu[1]+DoubleToString(AccountBalance(),2));
      ObjectSetString(0,"EQUITY",OBJPROP_TEXT,Menu[2]+DoubleToString(AccountEquity(),2));
      ObjectSetString(0,"DRAWDOWN",OBJPROP_TEXT,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%");
      ObjectSetString(0,"EARNED",OBJPROP_TEXT,Menu[4]+DoubleToString(GetProfit(),2));
      ObjectSetString(0,"EARNEDTODAY",OBJPROP_TEXT,Menu[5]+DoubleToString(GetProfitForDay(0),2));
      ObjectSetInteger(0,"ENG",OBJPROP_BGCOLOR,clrGreen);
      ObjectSetInteger(0,"RUS",OBJPROP_BGCOLOR,pnlcolor);
     }

  }
//+------------------------------------------------------------------+
double GetProfit() {
   double sum = 0;
   for (int i = 0; i < OrdersHistoryTotal(); i++) {
      if (!(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))) break;
      if(OrderType()==OP_BUY || OrderType()==OP_SELL)
      sum += OrderProfit() + OrderSwap() + OrderCommission();
   }
         
   return (sum);
}

double GetProfitForDay(int nd) {
   double profit = 0;
   for (int i = 0; i < OrdersHistoryTotal(); i++) {
      if (!(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))) break;
      if (OrderSymbol() == OrderSymbol())
         if (OrderCloseTime() >= iTime(Symbol(), PERIOD_D1, nd) && OrderCloseTime() < iTime(Symbol(), PERIOD_D1, nd) + 86400) profit += OrderProfit() + OrderSwap() + OrderCommission();
   }
   return (profit);
}
 
ArrayCopy(Menu,MenuENG,0,0,5);

6 am Ende des gesamten Codes einfügen

 
Maksim Sovenko:

6 am Ende des gesamten Codes einfügen

Einsetzen, keine Veränderung
 
long X=30,Y=80;
bool ChEvM=0,ChFg=0;
string MenuRUS[6]={"Текущие данные","Баланс: ","Эквити: ","Просадка: ","Общий заработок: ","Заработок сегодня: "};
string MenuENG[6]={"Current data","Balance: ","Equity: ","Drawdown: ","Earned: ","EARNEDTODAY: "};
string Menu[6];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   ArrayCopy(Menu,MenuENG,0,0,6);
   ChEvM=ChartGetInteger(0,CHART_EVENT_MOUSE_MOVE);
   ChFg=ChartGetInteger(0,CHART_FOREGROUND);
   ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,1);
   ChartSetInteger(0,CHART_FOREGROUND,0);
   if(ObjectFind(0,"HEAD")==-1)
     {
      ArrayCopy(Menu,MenuENG,0,0,6);
      EditCreate(0,"HEAD",0,X,Y,202,20,0,Menu[0],"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor,false,true);
      EditCreate(0,"BALANCE",0,X,Y+21,202,20,0,Menu[1]+DoubleToString(AccountBalance(),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"EQUITY",0,X,Y+42,202,20,0,Menu[2]+DoubleToString(AccountEquity(),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"DRAWDOWN",0,X,Y+63,202,20,0,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%","Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"EARNED",0,X,Y+84,202,20,0,Menu[4]+DoubleToString(GetProfit(),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"EARNEDTODAY",0,X,Y+105,202,20,0,Menu[5]+DoubleToString(GetProfitForDay(0),2),"Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"RUS",0,X+141,Y+105,30,20,0,"RUS","Arial",8,ALIGN_CENTER,true,txtcolor,pnlcolor,pnlcolor);
      EditCreate(0,"ENG",0,X+172,Y+105,30,20,0,"ENG","Arial",8,ALIGN_CENTER,true,txtcolor,clrGreen,pnlcolor);
      
     }
   else
     {
      if(ObjectGet("RUS",OBJPROP_BGCOLOR)==clrGreen)
        {
         ArrayCopy(Menu,MenuRUS,0,0,6);
        }
      else
        {
         ArrayCopy(Menu,MenuENG,0,0,6);
        }
     }
   EventSetTimer(1);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinit function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   if(reason!=3)
     {
      ObjectDelete(0,"HEAD");
      ObjectDelete(0,"BALANCE");
      ObjectDelete(0,"EQUITY");
      ObjectDelete(0,"DRAWDOWN");
      ObjectDelete(0,"EARNED");
      ObjectDelete(0,"EARNEDTODAY");
      ObjectDelete(0,"RUS");
      ObjectDelete(0,"ENG");
      ChartSetInteger(0,CHART_EVENT_MOUSE_MOVE,ChEvM);
      ChartSetInteger(0,CHART_FOREGROUND,ChFg);
      EventKillTimer();
     }
  }
//+------------------------------------------------------------------+
//| Function create object text                                      |
//+------------------------------------------------------------------+
bool EditCreate(const long             chart_ID=0,
                const string           name="Edit",
                const int              sub_window=0,
                const long             x=0,
                const long             y=0,
                const int              width=50,
                const int              height=18,
                const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER,
                const string           text="Text",
                const string           font="Arial",
                const int              font_size=10,
                const ENUM_ALIGN_MODE  align=ALIGN_CENTER,
                const bool             read_only=false,
                const color            clr=clrWhite,
                const color            back_clr=clrWhite,
                const color            border_clr=clrBlue,
                const bool             back=false,
                const bool             selection=false,
                const bool             hidden=true,
                const long             z_order=0)
  {

   ResetLastError();

   if(!ObjectCreate(chart_ID,name,OBJ_EDIT,sub_window,0,0))
     {
      Print(__FUNCTION__,
            "Code ERROR: ",GetLastError());
      return(false);
     }

   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);
   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width);
   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height);
   ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);
   ObjectSetString(chart_ID,name,OBJPROP_FONT,font);
   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size);
   ObjectSetInteger(chart_ID,name,OBJPROP_ALIGN,align);
   ObjectSetInteger(chart_ID,name,OBJPROP_READONLY,read_only);
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
   ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr);
   ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_COLOR,border_clr);
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
   return(true);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   if(AccountProfit()>0)ObjectSetInteger(0,"BALANCE",OBJPROP_BGCOLOR,clrGreen);
   if(AccountProfit()<0)ObjectSetInteger(0,"BALANCE",OBJPROP_BGCOLOR,clrRed);
   if(AccountProfit()==0)ObjectSetInteger(0,"BALANCE",OBJPROP_BGCOLOR,pnlcolor);
   ObjectSetString(0,"BALANCE",OBJPROP_TEXT,Menu[1]+DoubleToString(AccountBalance(),2));
   ObjectSetString(0,"EQUITY",OBJPROP_TEXT,Menu[2]+DoubleToString(AccountEquity(),2));
   ObjectSetString(0,"DRAWDOWN",OBJPROP_TEXT,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%");
   ObjectSetString(0,"EARNED",OBJPROP_TEXT,Menu[4]+DoubleToString(GetProfit(),2));
   ObjectSetString(0,"EARNEDTODAY",OBJPROP_TEXT,Menu[5]+DoubleToString(GetProfitForDay(0),2));
   return(rates_total);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
   if(id==CHARTEVENT_MOUSE_MOVE && sparam=="1")
     {
      X=ObjectGetInteger(0,"HEAD",OBJPROP_XDISTANCE);
      Y=ObjectGetInteger(0,"HEAD",OBJPROP_YDISTANCE);
      ObjectSetInteger(0,"BALANCE",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"BALANCE",OBJPROP_YDISTANCE,Y+21);
      ObjectSetInteger(0,"EQUITY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EQUITY",OBJPROP_YDISTANCE,Y+42);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_YDISTANCE,Y+63);
      ObjectSetInteger(0,"EARNED",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNED",OBJPROP_YDISTANCE,Y+84);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"RUS",OBJPROP_XDISTANCE,X+141);
      ObjectSetInteger(0,"RUS",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"ENG",OBJPROP_XDISTANCE,X+172);
      ObjectSetInteger(0,"ENG",OBJPROP_YDISTANCE,Y+105);
     }
   if(id==CHARTEVENT_OBJECT_CLICK && sparam=="HEAD")
     {
      X=ObjectGetInteger(0,"HEAD",OBJPROP_XDISTANCE);
      Y=ObjectGetInteger(0,"HEAD",OBJPROP_YDISTANCE);
      ObjectSetInteger(0,"BALANCE",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"BALANCE",OBJPROP_YDISTANCE,Y+21);
      ObjectSetInteger(0,"EQUITY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EQUITY",OBJPROP_YDISTANCE,Y+42);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"DRAWDOWN",OBJPROP_YDISTANCE,Y+63);
      ObjectSetInteger(0,"EARNED",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNED",OBJPROP_YDISTANCE,Y+84);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_XDISTANCE,X);
      ObjectSetInteger(0,"EARNEDTODAY",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"RUS",OBJPROP_XDISTANCE,X+141);
      ObjectSetInteger(0,"RUS",OBJPROP_YDISTANCE,Y+105);
      ObjectSetInteger(0,"ENG",OBJPROP_XDISTANCE,X+172);
      ObjectSetInteger(0,"ENG",OBJPROP_YDISTANCE,Y+105);
     }
   if(id==CHARTEVENT_OBJECT_CLICK && sparam=="RUS")
     {
      ArrayCopy(Menu,MenuRUS,0,0,6);
      ObjectSetString(0,"HEAD",OBJPROP_TEXT,Menu[0]);
      ObjectSetString(0,"BALANCE",OBJPROP_TEXT,Menu[1]+DoubleToString(AccountBalance(),2));
      ObjectSetString(0,"EQUITY",OBJPROP_TEXT,Menu[2]+DoubleToString(AccountEquity(),2));
      ObjectSetString(0,"DRAWDOWN",OBJPROP_TEXT,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%");
      ObjectSetString(0,"EARNED",OBJPROP_TEXT,Menu[4]+DoubleToString(GetProfit(),2));
      ObjectSetString(0,"EARNEDTODAY",OBJPROP_TEXT,Menu[5]+DoubleToString(GetProfitForDay(0),2));
      ObjectSetInteger(0,"ENG",OBJPROP_BGCOLOR,pnlcolor);
      ObjectSetInteger(0,"RUS",OBJPROP_BGCOLOR,clrGreen);
     }
   if(id==CHARTEVENT_OBJECT_CLICK && sparam=="ENG")
     {
      ArrayCopy(Menu,MenuENG,0,0,6);
      ObjectSetString(0,"HEAD",OBJPROP_TEXT,Menu[0]);
      ObjectSetString(0,"BALANCE",OBJPROP_TEXT,Menu[1]+DoubleToString(AccountBalance(),2));
      ObjectSetString(0,"EQUITY",OBJPROP_TEXT,Menu[2]+DoubleToString(AccountEquity(),2));
      ObjectSetString(0,"DRAWDOWN",OBJPROP_TEXT,Menu[3]+DoubleToString((AccountEquity()-AccountBalance())*100/AccountBalance(),2)+"%");
      ObjectSetString(0,"EARNED",OBJPROP_TEXT,Menu[4]+DoubleToString(GetProfit(),2));
      ObjectSetString(0,"EARNEDTODAY",OBJPROP_TEXT,Menu[5]+DoubleToString(GetProfitForDay(0),2));
      ObjectSetInteger(0,"ENG",OBJPROP_BGCOLOR,clrGreen);
      ObjectSetInteger(0,"RUS",OBJPROP_BGCOLOR,pnlcolor);
     }

  }
//+------------------------------------------------------------------+
double GetProfit() {
   double sum = 0;
   for (int i = 0; i < OrdersHistoryTotal(); i++) {
      if (!(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))) break;
      if(OrderType()==OP_BUY || OrderType()==OP_SELL)
      sum += OrderProfit() + OrderSwap() + OrderCommission();
   }
         
   return (sum);
}

double GetProfitForDay(int nd) {
   double profit = 0;
   for (int i = 0; i < OrdersHistoryTotal(); i++) {
      if (!(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))) break;
      if (OrderSymbol() == OrderSymbol())
         if (OrderCloseTime() >= iTime(Symbol(), PERIOD_D1, nd) && OrderCloseTime() < iTime(Symbol(), PERIOD_D1, nd) + 86400) profit += OrderProfit() + OrderSwap() + OrderCommission();
   }
   return (profit);
}