Price Data Components
Series array that contains close prices for each bar
0 Views
0 Downloads
0 Favorites
Last_Price
//+------------------------------------------------------------------+
//|                                                   Last_Price.mq4 |
//|                                                   Ex5            |
//|                                                                  |
//+------------------------------------------------------------------+
 

extern string simbol="CLG0#I";  // Ñèìâîë ñî çíàêîì #
extern color  Color_Ask=Red;
extern color  Color_Bid=PowderBlue;
extern bool  comment=true;

#property indicator_chart_window
 //----
 int deinit()
  {
   ObjectDelete("Line_Ask");
   ObjectDelete("Line_Bid");
   return(0);
  }
 //----
 
int start()
  {
   int    counted_bars=IndicatorCounted();
//----


   double ask=MarketInfo(simbol,MODE_ASK);
   double bid=iClose(simbol,0,0);
   
   ObjectCreate("Line_Ask",OBJ_HLINE,0,0,0);              //Ãîðèçîíòàëüíàÿ ëèíèÿ
   ObjectSet("Line_Ask",OBJPROP_COLOR,Color_Ask);
   ObjectMove("Line_Ask",0,ask,ask); 
   
   ObjectCreate("Line_Bid",OBJ_HLINE,0,0,0);              //Ãîðèçîíòàëüíàÿ ëèíèÿ
   ObjectSet("Line_Bid",OBJPROP_COLOR,Color_Bid);
   ObjectMove("Line_Bid",0,bid,bid); 
   
   if(comment==true) Comment(simbol,"  Ask:",ask,"  Bid:",bid,"  Ñïðåä:",(ask-bid)/Point);
   RefreshRates();
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments