Is it possible to draw a veticale line at 15min intervals and zero seconds on a chart regardless of the timeframe?
Here's what I have to draw a vertical line at 00:15:00.
It compiles but MT4 locks up, what a surprise with the things I try to do...any thoughts???
//+------------------------------------------------------------------+
//| 15minvline.mq4 |
//| Copyright 2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 C'255,255,255'
double ExtMapBuffer0[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,ExtMapBuffer0);
SetIndexStyle(0,DRAW_LINE,STYLE_DOT,1, C'255,255,255');
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if (counted_bars < 0) return (-1);
if (counted_bars > 0) counted_bars--;
int pos=Bars - counted_bars;
int min = Minute();
int sec = Seconds();
while(pos>0)
{
if ((min == 15) && (sec == 00))
SetIndexStyle(0,DRAW_LINE,STYLE_DOT,1, C'255,255,255');
}
//----
//----
return(0);
}
//+------------------------------------------------------------------+
Here's what I have to draw a vertical line at 00:15:00.
It compiles but MT4 locks up, what a surprise with the things I try to do...any thoughts???
//+------------------------------------------------------------------+
//| 15minvline.mq4 |
//| Copyright 2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 C'255,255,255'
double ExtMapBuffer0[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,ExtMapBuffer0);
SetIndexStyle(0,DRAW_LINE,STYLE_DOT,1, C'255,255,255');
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if (counted_bars < 0) return (-1);
if (counted_bars > 0) counted_bars--;
int pos=Bars - counted_bars;
int min = Minute();
int sec = Seconds();
while(pos>0)
{
if ((min == 15) && (sec == 00))
SetIndexStyle(0,DRAW_LINE,STYLE_DOT,1, C'255,255,255');
}
//----
//----
return(0);
}
//+------------------------------------------------------------------+