//+------------------------------------------------------------------+
//|                                             The Box Breakout.mq4 |
//|                                             Copyright © 2007, SF |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, NY Forex Team"
#property link      ""


#property indicator_separate_window

extern string IIIIIIIIIII  = "<<<<< Box >>>>>";   // Hora de cierre
extern string BoxEnd       = "15:00";   // Hora de cierre
extern int BoxLenght       = 2;
extern string IIIIIIIIII   = "<<<<< Trade >>>>>";   // Hora de cierre
extern int Margin          = 3;
extern int TP1             = 15;
extern int TP2             = 30;
extern int TP3             = 45;
//extern int SL              = 30;

extern string IIIIIIIIIIII   = "<<<<< Box look >>>>>";   // Hora de cierre
extern color  BoxColor     = LightGoldenrod;      // color
extern bool   ShowPrice    = True;      // Muestra el precio?
extern color  clFont       = White;      // color de fondo
extern int    SizeFont     = 10;         // Tamaño
extern int    OffSet       = 4;        // Ñìåùåíèå


double   top, bottom;
datetime left, right, daybegin, dayend, t3, t4, t99;
string   boxdaybegin, boxbegin, boxdayend, dhc, dhf;
int      b1, b2;

int init()
  {

   IndicatorShortName("New York Box");
   
   return(0);
  }


void deinit() 
{
    
  ObjectsDeleteAll (0,OBJ_HLINE);
  ObjectsDeleteAll (0,OBJ_VLINE);
  ObjectsDeleteAll (0,OBJ_LABEL);
  ObjectsDeleteAll (0,OBJ_RECTANGLE);
  ObjectsDeleteAll (0,OBJ_TEXT);
  ObjectsDeleteAll (1,OBJ_LABEL);

  
  Comment("");
}

// crea box
int start()
  {
  
   right = StrToTime (TimeToStr (TimeCurrent(),TIME_DATE) + " " + BoxEnd);

   if (right > TimeCurrent())
      {
         right = StrToTime (TimeToStr (TimeCurrent()- D'1970.01.01 23:59:59',TIME_DATE) + " " + BoxEnd);
      }


// si empieza en domingo suma 1 hora para comenzar a las 00 del lunes

   if (TimeDayOfWeek (right)==0)
      { 
         t99   = StrToTime (TimeToStr  (TimeCurrent()- D'1970.01.01 23:59:59',TIME_DATE) + " " + BoxEnd )  ;
         right = StrToTime (TimeToStr ( t99 + D'1970.01.01 1')); 
      }
      
      



   left = StrToTime (TimeToStr ( right - D'1970.01.01 1'* BoxLenght )); 
   
  
  
// si el box finaliza durante el weekend, se extiende para cerrar el viernes
   
   if (TimeDayOfWeek (left) == 0) 
      { 
      left = StrToTime (TimeToStr ( right - D'1970.01.01 1'* (BoxLenght +48) )); 
      }
      
      

      
   b1=iBarShift(NULL, 0, left);
   b2=iBarShift(NULL, 0, right);

  
  
   top = High [iHighest(NULL,0, MODE_HIGH,b1-b2, b2)];
   bottom=Low [Lowest (NULL, 0, MODE_LOW , b1-b2, b2)];
  

  ObjectCreate ("Box", OBJ_RECTANGLE,0,left, top, right,bottom);
  ObjectSet ("Box", OBJPROP_BACK, true);
  ObjectSet ("Box", OBJPROP_COLOR, BoxColor);
  
  
  ObjectCreate ("top",OBJ_HLINE, 0, 0,top);
  ObjectSet("top", OBJPROP_STYLE, STYLE_SOLID);
  ObjectSet("top", OBJPROP_COLOR,OrangeRed );
//  ObjectMove("top",top, Time[0],top );
  ObjectMove("top",0, Time[0],top );
  
  ObjectCreate ("left", OBJ_VLINE, 0, left, 0);
  ObjectSet("left", OBJPROP_STYLE, STYLE_DOT);
  ObjectSet("left", OBJPROP_COLOR,OrangeRed );
  
  ObjectCreate ("right", OBJ_VLINE, 0, right, 0);
  ObjectSet("right", OBJPROP_STYLE, STYLE_DOT);
  ObjectSet("right", OBJPROP_COLOR,OrangeRed );
  
  ObjectCreate ("bottom",OBJ_HLINE, 0, 0,bottom);
  ObjectSet("bottom", OBJPROP_STYLE, STYLE_SOLID);
  ObjectSet("bottom", OBJPROP_COLOR,OrangeRed );
//  ObjectMove("bottom",bottom, Time[0],bottom );
  ObjectMove("bottom",0, Time[0],bottom );

// pone los precios

  if (ObjectFind("BoxHigh")<0) ObjectCreate("BoxHigh", OBJ_TEXT, 0, 0,0);
  ObjectSet("BoxHigh", OBJPROP_TIME1   , right);
  ObjectSet("BoxHigh", OBJPROP_PRICE1  , top+OffSet*Point);
  ObjectSet("BoxHigh", OBJPROP_COLOR   , clFont);
  ObjectSet("BoxHigh", OBJPROP_FONTSIZE, SizeFont);
  ObjectSetText("BoxHigh", "HIGH: "+DoubleToStr(top, Digits));

  if (ObjectFind("BoxLow")<0) ObjectCreate("BoxLow", OBJ_TEXT, 0, 0,0);
  ObjectSet("BoxLow", OBJPROP_TIME1   , right);
  ObjectSet("BoxLow", OBJPROP_PRICE1  , bottom);
  ObjectSet("BoxLow", OBJPROP_COLOR   , clFont);
  ObjectSet("BoxLow", OBJPROP_FONTSIZE, SizeFont);
  ObjectSetText("BoxLow", "LOW: "+DoubleToStr(bottom, Digits));

/// Calculo de entradas 

double bep, btp1, btp2, btp3, btp4, bsl;
double sep, stp1, stp2, stp3, stp4, ssl;
double drange;

   bep  = top+ (Margin * Point);
   btp1 = bep+TP1*Point;
   btp2 = bep+TP2*Point; 
   btp3 = bep+TP3*Point;
   btp4 = btp3+25*Point;
   bsl  = bottom;
//   bsl  = bep-SL*Point; 
  
   sep  = bottom-Margin*Point;
   stp1 = sep-TP1*Point;
   stp2 = sep-TP2*Point; 
   stp3 = sep-TP3*Point;
   stp4 = stp3-25*Point;
   ssl  = top;
//   ssl  = sep+SL*Point; 

   drange = (top-bottom)/Point;



// Lineas

  ObjectCreate("BATL", OBJ_TEXT, 0, Time[0], bep);
  ObjectSetText("BATL", " BUY AT @ "+DoubleToStr(bep,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("BATL",bep, Time[0],bep );
  ObjectMove("BATL",0, Time[0],bep );
  
  ObjectCreate ("BAT",OBJ_HLINE, 0, 0,bep);
  ObjectSet("BAT", OBJPROP_STYLE, STYLE_SOLID);
  ObjectSet("BAT", OBJPROP_COLOR,SpringGreen );
//  ObjectMove("BAT",bep, Time[0],bep );
  ObjectMove("BAT",0, Time[0],bep );
  
  ObjectCreate("BTP1L", OBJ_TEXT, 0, Time[0], btp1);
  ObjectSetText("BTP1L", " PROFIT TARGET 1: "+DoubleToStr(btp1,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("BTP1L",btp1, Time[0],btp1 );
  ObjectMove("BTP1L",0, Time[0],btp1 );

  ObjectCreate ("BTP1",OBJ_HLINE, 0, 0,btp1);
  ObjectSet("BTP1", OBJPROP_STYLE, STYLE_DASHDOTDOT);
  ObjectSet("BTP1", OBJPROP_COLOR,SpringGreen );
//  ObjectMove("BTP1",btp1, Time[0],btp1 );
  ObjectMove("BTP1",0, Time[0],btp1 );

  ObjectCreate("BTP2L", OBJ_TEXT, 0, Time[0], btp2);
  ObjectSetText("BTP2L", " PROFIT TARGET 2: "+DoubleToStr(btp2,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("BTP2L",btp2, Time[0],btp2 );
  ObjectMove("BTP2L",0, Time[0],btp2 );

  ObjectCreate ("BTP2",OBJ_HLINE, 0, 0,btp2);
  ObjectSet("BTP2", OBJPROP_STYLE, STYLE_DASHDOTDOT);
  ObjectSet("BTP2", OBJPROP_COLOR,SpringGreen );
//  ObjectMove("BTP2",btp2, Time[0],btp2 );
  ObjectMove("BTP2",0, Time[0],btp2 );
  
  ObjectCreate("BTP3L", OBJ_TEXT, 0, Time[0], btp3);
  ObjectSetText("BTP3L", " PROFIT TARGET 3: "+DoubleToStr(btp3,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("BTP3L",btp3, Time[0],btp3 );
  ObjectMove("BTP3L",0, Time[0],btp3 );

  ObjectCreate ("BTP3",OBJ_HLINE, 0, 0,btp3);
  ObjectSet("BTP3", OBJPROP_STYLE, STYLE_DASHDOTDOT);
  ObjectSet("BTP3", OBJPROP_COLOR,SpringGreen );
//  ObjectMove("BTP3",btp3, Time[0],btp3 );
  ObjectMove("BTP3",0, Time[0],btp3 );

  ObjectCreate("SATL", OBJ_TEXT, 0, Time[0], sep);
  ObjectSetText("SATL", " SELL AT @ "+DoubleToStr(sep,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("SATL",sep, Time[0],sep );
  ObjectMove("SATL",0, Time[0],sep );
  
  ObjectCreate ("SAT",OBJ_HLINE, 0, 0,sep);
  ObjectSet("SAT", OBJPROP_STYLE, STYLE_SOLID);
  ObjectSet("SAT", OBJPROP_COLOR,OrangeRed );
//  ObjectMove("SAT",sep, Time[0],sep );
  ObjectMove("SAT",0, Time[0],sep );
  
  ObjectCreate("STP1L", OBJ_TEXT, 0, Time[0], stp1);
  ObjectSetText("STP1L", " PROFIT TARGET 1: "+DoubleToStr(stp1,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("STP1L",stp1, Time[0],stp1 );
  ObjectMove("STP1L",0, Time[0],stp1 );

  ObjectCreate ("STP1",OBJ_HLINE, 0, 0,stp1);
  ObjectSet("STP1", OBJPROP_STYLE, STYLE_DASHDOTDOT);
  ObjectSet("STP1", OBJPROP_COLOR,OrangeRed );
//  ObjectMove("STP1",stp1, Time[0],stp1 );
  ObjectMove("STP1",0, Time[0],stp1 );
  
  ObjectCreate("STP2L", OBJ_TEXT, 0, Time[0], stp2);
  ObjectSetText("STP2L", " PROFIT TARGET 2: "+DoubleToStr(stp2,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("STP2L",stp2, Time[0],stp2 );
  ObjectMove("STP2L",0, Time[0],stp2 );

  ObjectCreate ("STP2",OBJ_HLINE, 0, 0,stp2);
  ObjectSet("STP2", OBJPROP_STYLE, STYLE_DASHDOTDOT);
  ObjectSet("STP2", OBJPROP_COLOR,OrangeRed );
//  ObjectMove("STP2",stp2, Time[0],stp2 );
  ObjectMove("STP2",0, Time[0],stp2 );
  
  ObjectCreate("STP3L", OBJ_TEXT, 0, Time[0], stp3);
  ObjectSetText("STP3L", " PROFIT TARGET 3: "+DoubleToStr(stp3,Digits)+"", 8, "Arial", Silver);
//  ObjectMove("STP3L",stp3, Time[0],stp3 );
  ObjectMove("STP3L",0, Time[0],stp3 );

  ObjectCreate ("STP3",OBJ_HLINE, 0, 0,stp3);
  ObjectSet("STP3", OBJPROP_STYLE, STYLE_DASHDOTDOT);
  ObjectSet("STP3", OBJPROP_COLOR,OrangeRed );
//  ObjectMove("STP3",stp3, Time[0],stp3 );
  ObjectMove("STP3",0, Time[0],stp3 );



  
      if (ObjectFind("BuyZone")<0) ObjectCreate("BuyZone", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("BuyZone", OBJPROP_TIME1   , right);
      ObjectSet("BuyZone", OBJPROP_PRICE1  , btp1);
      ObjectSet("BuyZone", OBJPROP_TIME2   , Time [0]);
      ObjectSet("BuyZone", OBJPROP_PRICE2  , bep);
      ObjectSet("BuyZone", OBJPROP_COLOR   , C'0,0,150');

      if (ObjectFind("BuyTP1")<0) ObjectCreate("BuyTP1", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("BuyTP1", OBJPROP_TIME1   , right);
      ObjectSet("BuyTP1", OBJPROP_PRICE1  , btp2);
      ObjectSet("BuyTP1", OBJPROP_TIME2   , Time [0]);
      ObjectSet("BuyTP1", OBJPROP_PRICE2  , btp1);
      ObjectSet("BuyTP1", OBJPROP_COLOR   , C'0,0,190');
      
      if (ObjectFind("BuyTP2")<0) ObjectCreate("BuyTP2", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("BuyTP2", OBJPROP_TIME1   , right);
      ObjectSet("BuyTP2", OBJPROP_PRICE1  , btp3);
      ObjectSet("BuyTP2", OBJPROP_TIME2   , Time [0]);
      ObjectSet("BuyTP2", OBJPROP_PRICE2  , btp2);
      ObjectSet("BuyTP2", OBJPROP_COLOR   , C'0,0,220');
      
      if (ObjectFind("BuyTP3")<0) ObjectCreate("BuyTP3", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("BuyTP3", OBJPROP_TIME1   , right);
      ObjectSet("BuyTP3", OBJPROP_PRICE1  , btp4);
      ObjectSet("BuyTP3", OBJPROP_TIME2   , Time [0]);
      ObjectSet("BuyTP3", OBJPROP_PRICE2  , btp3);
      ObjectSet("BuyTP3", OBJPROP_COLOR   , C'0,0,225');
      
      if (ObjectFind("SellZone")<0) ObjectCreate("SellZone", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("SellZone", OBJPROP_TIME1   , right);
      ObjectSet("SellZone", OBJPROP_PRICE1  , stp1);
      ObjectSet("SellZone", OBJPROP_TIME2   , Time [0]);
      ObjectSet("SellZone", OBJPROP_PRICE2  , sep);
      ObjectSet("SellZone", OBJPROP_COLOR   , C'120,0,0');
      
      if (ObjectFind("SellTP1")<0) ObjectCreate("SellTP1", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("SellTP1", OBJPROP_TIME1   , right);
      ObjectSet("SellTP1", OBJPROP_PRICE1  , stp2);
      ObjectSet("SellTP1", OBJPROP_TIME2   , Time [0]);
      ObjectSet("SellTP1", OBJPROP_PRICE2  , stp1);
      ObjectSet("SellTP1", OBJPROP_COLOR   , C'190,0,0');
 
      if (ObjectFind("SellTP2")<0) ObjectCreate("SellTP2", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("SellTP2", OBJPROP_TIME1   , right);
      ObjectSet("SellTP2", OBJPROP_PRICE1  , stp3);
      ObjectSet("SellTP2", OBJPROP_TIME2   , Time [0]);
      ObjectSet("SellTP2", OBJPROP_PRICE2  , stp2);
      ObjectSet("SellTP2", OBJPROP_COLOR   , C'220,0,0');
      
      if (ObjectFind("SellTP3")<0) ObjectCreate("SellTP3", OBJ_RECTANGLE, 0,0, 0,0);
      ObjectSet("SellTP3", OBJPROP_TIME1   , right);
      ObjectSet("SellTP3", OBJPROP_PRICE1  , stp4);
      ObjectSet("SellTP3", OBJPROP_TIME2   , Time [0]);
      ObjectSet("SellTP3", OBJPROP_PRICE2  , stp3);
      ObjectSet("SellTP3", OBJPROP_COLOR   , C'255,0,0');
      
   
// Label


   ObjectCreate ("Name",OBJ_LABEL, 0,0,0);
   ObjectSetText("Name", "Daily Range: "+ DoubleToStr(drange,Point) + " pips.", 10,"Georgia", Yellow);
   ObjectSet("Name", OBJPROP_CORNER, 0);
   ObjectSet("Name", OBJPROP_XDISTANCE, 5);
   ObjectSet("Name", OBJPROP_YDISTANCE, 20);
   
   ObjectCreate ("B1",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B1", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", 8,"Arial Bold", White);
   ObjectSet("B1", OBJPROP_CORNER, 0);
   ObjectSet("B1", OBJPROP_XDISTANCE, 5);
   ObjectSet("B1", OBJPROP_YDISTANCE, 10);
   
   ObjectCreate ("B2",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B2", "BUY ZONE", 9,"Arial Bold", DeepSkyBlue);
   ObjectSet("B2", OBJPROP_CORNER, 0);
   ObjectSet("B2", OBJPROP_XDISTANCE, 5);
   ObjectSet("B2", OBJPROP_YDISTANCE, 25);

   ObjectCreate ("B3",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B3", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", 8,"Arial Bold", White);
   ObjectSet("B3", OBJPROP_CORNER, 0);
   ObjectSet("B3", OBJPROP_XDISTANCE, 5);
   ObjectSet("B3", OBJPROP_YDISTANCE, 35);
  
   
   ObjectCreate ("B4",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B4", "BUY "+Symbol()+ " AT @", 9,"Arial Bold", DodgerBlue);
   ObjectSet("B4", OBJPROP_CORNER, 0);
   ObjectSet("B4", OBJPROP_XDISTANCE, 5);
   ObjectSet("B4", OBJPROP_YDISTANCE, 50);
   
   ObjectCreate ("B5",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B5",DoubleToStr (bep,Digits), 9,"Arial Bold", DarkOrange);
   ObjectSet("B5", OBJPROP_CORNER, 0);
   ObjectSet("B5", OBJPROP_XDISTANCE, 120);
   ObjectSet("B5", OBJPROP_YDISTANCE, 50);

   ObjectCreate ("B6",OBJ_LABEL, WindowFind("New York Box"),0,0);
   ObjectSetText("B6", "TP 1                 TP 2                  TP3", 9,"Arial Bold", DodgerBlue);
   ObjectSet("B6", OBJPROP_CORNER, 0);
   ObjectSet("B6", OBJPROP_XDISTANCE, 5);
   ObjectSet("B6", OBJPROP_YDISTANCE, 70);
   

   ObjectCreate ("B7",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B7",DoubleToStr (btp1,Digits)+"             "+ DoubleToStr (btp2,Digits)+"             "+ DoubleToStr (btp3,Digits), 9,"Arial Bold", YellowGreen);
   ObjectSet("B7", OBJPROP_CORNER, 0);
   ObjectSet("B7", OBJPROP_XDISTANCE, 35);
   ObjectSet("B7", OBJPROP_YDISTANCE, 70);

   ObjectCreate ("B8",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B8", "SL", 9,"Arial Bold", DodgerBlue);
   ObjectSet("B8", OBJPROP_CORNER, 0);
   ObjectSet("B8", OBJPROP_XDISTANCE, 5);
   ObjectSet("B8", OBJPROP_YDISTANCE, 90);

   ObjectCreate ("B9",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B9",DoubleToStr (bsl,Digits), 9,"Arial Bold", Yellow);
   ObjectSet("B9", OBJPROP_CORNER, 0);
   ObjectSet("B9", OBJPROP_XDISTANCE, 35);
   ObjectSet("B9", OBJPROP_YDISTANCE, 90);
   

   ObjectCreate ("B11",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B11", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", 8,"Arial Bold", White);
   ObjectSet("B11", OBJPROP_CORNER, 0);
   ObjectSet("B11", OBJPROP_XDISTANCE, 305);
   ObjectSet("B11", OBJPROP_YDISTANCE, 10);
   
   ObjectCreate ("B12",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B12", "SELL ZONE", 9,"Arial Bold", Orange);
   ObjectSet("B12", OBJPROP_CORNER, 0);
   ObjectSet("B12", OBJPROP_XDISTANCE, 305);
   ObjectSet("B12", OBJPROP_YDISTANCE, 25);

   ObjectCreate ("B13",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B13", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", 8,"Arial Bold", White);
   ObjectSet("B13", OBJPROP_CORNER, 0);
   ObjectSet("B13", OBJPROP_XDISTANCE, 305);
   ObjectSet("B13", OBJPROP_YDISTANCE, 35);
  
//

   ObjectCreate ("B14",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B14", "SELL "+Symbol()+ " AT @", 9,"Arial Bold", OrangeRed);
   ObjectSet("B14", OBJPROP_CORNER, 0);
   ObjectSet("B14", OBJPROP_XDISTANCE, 305);
   ObjectSet("B14", OBJPROP_YDISTANCE, 50);
   
   ObjectCreate ("B15",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B15",DoubleToStr (sep,Digits), 9,"Arial Bold", DarkOrange);
   ObjectSet("B15", OBJPROP_CORNER, 0);
   ObjectSet("B15", OBJPROP_XDISTANCE, 430);
   ObjectSet("B15", OBJPROP_YDISTANCE, 50);

   ObjectCreate ("B16",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B16", "TP 1                 TP 2                  TP3", 9,"Arial Bold", OrangeRed);
   ObjectSet("B16", OBJPROP_CORNER, 0);
   ObjectSet("B16", OBJPROP_XDISTANCE, 305);
   ObjectSet("B16", OBJPROP_YDISTANCE, 70);
   

   ObjectCreate ("B17",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B17",DoubleToStr (stp1,Digits)+"             "+ DoubleToStr (stp2,Digits)+"             "+ DoubleToStr (stp3,Digits), 9,"Arial Bold", YellowGreen);
   ObjectSet("B17", OBJPROP_CORNER, 0);
   ObjectSet("B17", OBJPROP_XDISTANCE, 335);
   ObjectSet("B17", OBJPROP_YDISTANCE, 70);

   ObjectCreate ("B18",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B18", "SL", 9,"Arial Bold", OrangeRed);
   ObjectSet("B18", OBJPROP_CORNER, 0);
   ObjectSet("B18", OBJPROP_XDISTANCE, 305);
   ObjectSet("B18", OBJPROP_YDISTANCE, 90);

   ObjectCreate ("B19",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B19",DoubleToStr (ssl,Digits), 9,"Arial Bold", Yellow);
   ObjectSet("B19", OBJPROP_CORNER, 0);
   ObjectSet("B19", OBJPROP_XDISTANCE, 335);
   ObjectSet("B19", OBJPROP_YDISTANCE, 90);
   
   ObjectCreate ("B20",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B20", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", 8,"Arial Bold", White);
   ObjectSet("B20", OBJPROP_CORNER, 0);
   ObjectSet("B20", OBJPROP_XDISTANCE, 5);
   ObjectSet("B20", OBJPROP_YDISTANCE, 105);
   
   ObjectCreate ("B210",OBJ_LABEL,  WindowFind("New York Box"),0,0);
   ObjectSetText("B210", ",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,", 8,"Arial Bold", White);
   ObjectSet("B210", OBJPROP_CORNER, 0);
   ObjectSet("B210", OBJPROP_XDISTANCE, 305);
   ObjectSet("B210", OBJPROP_YDISTANCE, 105);

   
   ObjectCreate ("B21",OBJ_LABEL,  0,0,0);
   ObjectSetText("B21", "PRICE", 10,"Arial Bold", Silver);
   ObjectSet("B21", OBJPROP_CORNER, 0);
   ObjectSet("B21", OBJPROP_XDISTANCE, 5);
   ObjectSet("B21", OBJPROP_YDISTANCE, 255);
   
   ObjectCreate ("B22",OBJ_LABEL,  0,0,0);
   ObjectSetText("B22",DoubleToStr (Bid,Digits), 15,"Arial Bold", Silver);
   ObjectSet("B22", OBJPROP_CORNER, 0);
   ObjectSet("B22", OBJPROP_XDISTANCE, 55);
   ObjectSet("B22", OBJPROP_YDISTANCE, 250);

// prueba   
   
  
 

  
   
   


   return(0);
  }