//+------------------------------------------------------------------+ //| test.mq5 | //| Copyright 2012, mohsen khashei | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2012, mohsen khashei" #property link "http://www.mql5.com" #property version "1.00" #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ input datetime End=D'2012.03.18'; //End Date Time int OnInit() { //--- indicator buffers mapping //--- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //--- datetime dt=End+102*PeriodSeconds(); ObjectCreate(0,"end", OBJ_VLINE, 0, End, 0 ); ObjectSetInteger(0,"end", OBJPROP_STYLE,STYLE_DOT); ObjectSetInteger(0,"end", OBJPROP_COLOR, LimeGreen); ObjectCreate(0,"test",OBJ_VLINE,0,dt,0); ObjectSetInteger(0,"test",OBJPROP_COLOR,DarkOrange); //--- return value of prev_calculated for next call return(rates_total); } //+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { //--- } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam) { //--- } //+------------------------------------------------------------------+