Ticaret robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Telegram üzerinde bulun!
Fan sayfamıza katılın
Komut dosyasını ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Komut dosyasını beğendiniz mi? MetaTrader 5 terminalinde deneyin
Görüntülemeler:
13091
Derecelendirme:
(25)
Yayınlandı:
2017.08.10 10:54
Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

The indicator draws a vertical line (OBJ_VLINE) and then moves it to the specified time (hours and minutes).

Input parameters :

Vertical line, inputs

Only hours and minutes are used from the "Use only Hours and minutes" parameter. 

The vertical line is drawn for the current day. If a new day begins, the line is moved to this new day, and is set at the specified hour and minute.

Video:


The indicator has a built-in protection against accidental deletion of the vertical line: the timer periodically checks the existence of the line on the chart. If the vertical line (OBJ_VLINE) is not found, the static variable "prev_date" declared at the global program level is reset to zero:

//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//--- protection against unauthorized deletion
   if(ObjectFind(0,InpName)<0)
     {
      prev_date=0;
      VLineCreate(0,InpName,0,0.0,InpColor,InpStyle,InpWidth);
     }
  }

This will cause the creation of a new vertical line in OnCalculate():

   if(prev_date==0) // first start
     {
      MqlDateTime str_input;
      TimeToStruct(InpTime,str_input);
      str_to_draw.hour=str_input.hour;
      str_to_draw.min=str_input.min;
      str_to_draw.sec=0;

      prev_date=StructToTime(str_to_draw);
      VLineMove(0,InpName,prev_date);

      return(rates_total);
     }


MetaQuotes Ltd tarafından Rusçadan çevrilmiştir.
Orijinal kod: https://www.mql5.com/ru/code/18449

Exp_NRTR_ATR_STOP Exp_NRTR_ATR_STOP

The trading system is based on the NRTR_ATR_STOP indicator signals.

exp_Amstell-SL exp_Amstell-SL

The EA buys if the open price of the last position is higher than the current price.

i4_GoldenLionTrend_v3 i4_GoldenLionTrend_v3

A trend strength indicator using two Bollinger channels.

OscSAR_Histogram_HTF OscSAR_Histogram_HTF

The OscSAR_Histogram indicator with the timeframe selection option available in the indicator input parameters.