//+------------------------------------------------------------------+
//|                                     Copyright � 2010, Konstantin |
//|                                     http://www.fxaktiv.com       |
//|     �������� ������. ���������, ����������, �������. ���� �� 20$.|
//|     �������������� (�� 30%)!                                     |
//|     panelektrik@yandex.ru skype pan--elektrik ISQ 561090193      |
//|     ���. +380 50 7115118                                         |
//+------------------------------------------------------------------+
#property copyright "Copyright � 2010, Konstantin"
#property link      "http://www.fxaktiv.com"
#property indicator_chart_window

//----     
 extern string Simbol1 = "ESZ0"; extern double k1 =1;
 extern string Simbol2 = "NQZ0"; extern double k2 =1;
 extern double lot =1;
//---- 


//+------------------------------------------------------------------+
void object(string z,string x,int b,color c,int v,int w)
 {ObjectCreate(z,OBJ_LABEL,0,0,0);ObjectSetText(z,x,b,"Times New Roman",c);
 ObjectSet(z,OBJPROP_CORNER,w);ObjectSet(z,OBJPROP_XDISTANCE,4);
 ObjectSet(z,OBJPROP_YDISTANCE,v);}
//+------------------------------------------------------------------+
double StoimPunkt(string B){return(MarketInfo(B,MODE_TICKVALUE)/(MarketInfo(B,MODE_TICKSIZE)/MarketInfo(B,MODE_POINT)));}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ 
void info2()
 {
 int v1 =MarketInfo(Simbol1,MODE_TRADEALLOWED);
 int v2 =MarketInfo(Simbol2,MODE_TRADEALLOWED);
 string s11 =DoubleToStr(sred(0,Simbol1)*lot*k1,1);
 string s12 =DoubleToStr(sred(1,Simbol1)*lot*k1,1);
 string s21 =DoubleToStr(sred(0,Simbol2)*lot*k2,1);
 string s22 =DoubleToStr(sred(1,Simbol2)*lot*k2,1); 
 double margin1=MarketInfo(Simbol1,MODE_MARGINREQUIRED)*lot*k1;
 double margin2=MarketInfo(Simbol2,MODE_MARGINREQUIRED)*lot*k2;
 int exp1 =MarketInfo(Simbol1,MODE_EXPIRATION);
 int exp2 =MarketInfo(Simbol2,MODE_EXPIRATION); 
 object("Simbol1+",Simbol1+"  C�������� ������ = "+DoubleToStr(StoimPunkt(Simbol1),2)+"  ����� = "+v1,8,Gold,55,2);
 object("Simbol1++","��� = "+DoubleToStr(lot*k1,2)+"  ����� = "+DoubleToStr(margin1,0)+"  ����� = "+s11+" + "+s12+" ",8,Gold,45,2);
 object("Simbol1+++","���������� = "+TimeToStr(exp1),8,Gold,35,2);
 object("Simbol2+",Simbol2+"  ��������� ������ = "+DoubleToStr(StoimPunkt(Simbol2),2)+"  ����� = "+v2,8,White,25,2);
 object("Simbol2++","��� = "+DoubleToStr(lot*k2,2)+"  ����� = "+DoubleToStr(margin2,0)+"  ����� = "+s21+" + "+s22+" ",8,White,15,2);
 object("Simbol2+++","���������� = "+ TimeToStr(exp2),8,White,5,2);}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
double sred(int typ,string B)
 {double j;RefreshRates();
 if(typ==0)j=((MarketInfo(B+"#I",MODE_ASK)-MarketInfo(B,MODE_BID))/MarketInfo(B,MODE_POINT))*StoimPunkt(B);
 if(typ==1)j=((MarketInfo(B,MODE_BID)-MarketInfo(B+"#I",MODE_BID))/MarketInfo(B,MODE_POINT))*StoimPunkt(B);
 if(j<0)j=0;return(j);}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ 
int start()
  {
   info2();
  }
//+------------------------------------------------------------------+