sign by time

Author: Wen Tao Xiong
0 Views
0 Downloads
0 Favorites
sign by time
ÿþ//+------------------------------------------------------------------+

//|                                                    sign by time.mq5 |

//|                                        wx=> wentxiong |

//|                                        http://www.popoding.club/ |

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

#property copyright "Wen Tao Xiong"

#property link      "https://www.mql5.com/zh/users/xiongsir/seller"

#property version   "1.00"

#property  script_show_inputs



input datetime time_start = D'2021.04.01 00:00:00';   //wËYöeô•

input datetime time_end = D'2021.04.21 00:00:00';     //È~bköeô•



input color line_clr = clrBlue;  

input ENUM_LINE_STYLE line_style  = STYLE_SOLID;   

input int line_width = 2; 



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

//| Script program start function                                    |

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

void OnStart()

  {

//---





   datetime line_times[];

   CopyTime(Symbol(),PERIOD_H1,time_start,time_end,line_times);





   for(int i = 0 ; i < ArraySize(line_times); i++)

     {



      MqlDateTime line_time_struct;

      TimeToStruct(line_times[i],line_time_struct);

      if(line_time_struct.hour == 8 && line_time_struct.min == 0 && line_time_struct.sec == 0)

        {

         string line_name = TimeToString(line_times[i]);

         ObjectCreate(0,line_name,OBJ_VLINE,0,line_times[i],0);





         ObjectSetInteger(0,line_name,OBJPROP_COLOR,line_clr);

         ObjectSetInteger(0,line_name,OBJPROP_STYLE,line_style);

         ObjectSetInteger(0,line_name,OBJPROP_WIDTH,line_width);



        }

     }

  }

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

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 ---