Draw_Vertical_Lines_at_Time

Author: Copyright © 2017, TR4DEX
0 Views
0 Downloads
0 Favorites
Draw_Vertical_Lines_at_Time
ÿþ//+------------------------------------------------+

//| File        | Draw_Vertical_Lines_at_Time.mq4  |

//| Description | Draw vertical lines at time.     |

//| Copyright   | TR4DEX                           |

//| Website     | http://www.tr4dex.com            | 

//+------------------------------------------------+

#property copyright "Copyright © 2017, TR4DEX"

#property link      "http://www.tr4dex.com"

#property indicator_chart_window

#property strict



extern int   HOUR                = 4; //Hour to draw the lines

extern int   MINUTE              = 0; //Minute to draw the lines

extern color Line_Color          = clrBlack; //Color of the lines

input ENUM_LINE_STYLE Line_Style = STYLE_DASH; //Style of the lines



string name = "TimeLine";



int init()

{

   return(0);

}

  

void deinit()

{

   ObjectsDeleteAll();

   Comment("");

}



void start()

{

   int Counted_bars=IndicatorCounted(); 

   int i=Bars-Counted_bars-1;           

   

   while(i>=0)                       

   {  

      if(TimeHour(Time[i]) == HOUR && TimeMinute(Time[i]) == MINUTE)

      {

         if (ObjectFind(name+DoubleToStr(Time[i])) != 0)

         {

            ObjectCreate(name+DoubleToStr(Time[i]), OBJ_VLINE, 0, Time[i], 0);

            ObjectSetInteger(0,name+DoubleToStr(Time[i]),OBJPROP_STYLE,Line_Style);

            ObjectSet(name+DoubleToStr(Time[i]), OBJPROP_COLOR, Line_Color);

         }

      }

      i--;

   }

}



Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---