//+------------------------------------------------------------------+
//|             Copyright © 2010, Konstantin http://www.fxaktiv.com  |
//|                        panelektrik@yandex.ru skype pan--elektrik |
//|                                ISQ 561090193 Моб.+380 50 7115118 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Konstantin"
#property link      "http://www.fxaktiv.com  panelektrik@yandex.ru skype pan--elektrik ISQ 561090193 Моб.+380 50 7115118"
#property show_inputs
//------------------------------------------------------
extern double lot=0.01;
int TP=500;
int SL=500;
//------------------------------------------------------
int objekt(string Trade){ObjectCreate("lot",OBJ_LABEL,0,0,0);
 ObjectSetText("lot","lot= "+Trade, 10,"Times New Roman",Tomato);
 ObjectSet("lot", OBJPROP_CORNER, 1);
 ObjectSet("lot", OBJPROP_XDISTANCE, 20);
 ObjectSet("lot", OBJPROP_YDISTANCE, 60);}
//------------------------------------------------------  
int start()
  {
//------------------------------------------------------   
   if(ObjectGet("CENA", OBJ_HLINE)==0){
   ObjectCreate("CENA", OBJ_HLINE, 0, 0,Bid+(Ask-Bid)*10);
   ObjectSet("CENA",OBJPROP_COLOR,Aquamarine);}
   if(ObjectGet("TP", OBJ_HLINE)==0){
   ObjectCreate("TP", OBJ_HLINE, 0, 0,Bid+TP*Point);
   ObjectSet("TP",OBJPROP_COLOR,LightSkyBlue);}
   if(ObjectGet("SL", OBJ_HLINE)==0){
   ObjectCreate("SL", OBJ_HLINE, 0, 0,Bid-SL*Point);
   ObjectSet("SL",OBJPROP_COLOR,LightCoral);}
   objekt(DoubleToStr(lot,2));   
//------------------------------------------------------  
   if((ObjectGet("CENA",OBJPROP_PRICE1)!=Bid+(Ask-Bid)*10)||(ObjectGet("TP",OBJPROP_PRICE1)!=Bid+TP*Point)||(ObjectGet("SL",OBJPROP_PRICE1)!=Bid-SL*Point))
   {
   double CENA=ObjectGet("CENA",OBJPROP_PRICE1);
   double sl=ObjectGet("SL",OBJPROP_PRICE1);   
   double tp=ObjectGet("TP",OBJPROP_PRICE1);
   OrderSend(Symbol(),OP_BUYSTOP,lot,NormalizeDouble(CENA,Digits),10,NormalizeDouble(sl,Digits),NormalizeDouble(tp,Digits),"скрипт",111,0,Blue);  
   Print(GetLastError());
   ObjectDelete("CENA");
   ObjectDelete("TP");
   ObjectDelete("SL");
   ObjectDelete("lot");
   PlaySound("Wait.wav");
   } 
//------------------------------------------------------
  }
//+------------------------------------------------------------------+