Author: Copyright 2011, Alexander Piechotta
1 Views
0 Downloads
0 Favorites
Example_1
//+------------------------------------------------------------------+
//|                                                    Example 1.mq5 |
//|                              Copyright 2011, Alexander Piechotta |
//|                                        http://www.metatraders.de |
//+------------------------------------------------------------------+
#property copyright "Copyright 2011, Alexander Piechotta"
#property link      "http://www.metatraders.de"
#property version   "1.00"

#include <MyComment.mqh>

MyComment AddComment;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer

   EventSetTimer(2);
   AddComment.Add_MyComment("initialization...");
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {

   AddComment.chartID=ChartID();           // use current chart
   AddComment.SHOW_CurrentLocalTime=false; // show CurrentLocalTime OFF
   AddComment.SHOW_MQL5ProgramName=false;  // show MQL5ProgramName OFF

   AddComment.Add_MyComment("Greetings from Germany.");
  }
//+------------------------------------------------------------------+

Comments