Price Data Components
0
Views
0
Downloads
0
Favorites
b-clock_6h-m-s7
//+------------------------------------------------------------------+
//| b-clock.mq4 |
//| Core time code by Nick Bilak |
//| http://metatrader.50webs.com/ beluck[at]gmail.com |
//| modified by adoleh2000 and dwt5 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, Nick Bilak"
#property link "http://metatrader.50webs.com/"
// hours added by bgaiteiro
#property indicator_chart_window
extern color ClockColor=Purple;
//---- buffers
double s1[];
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("time");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double i;
int h,m,s,k;
m=Time[0]+Period()*60-CurTime();
i=m/60.0;
s=m%60;
m=(m-m%60)/60;
h=i/60;
k=m-(h*60);
Comment(h+" hours "+k+" minutes e "+s+" seconds to close bar");
ObjectDelete("time");
if(ObjectFind("time")!=0)
{
ObjectCreate("time",OBJ_TEXT,0,Time[0],Close[0]+0.0005);
ObjectSetText("time"," <"+h+":"+k+":"+s,8,"Arial",ClockColor);
}
else
{
ObjectMove("time",0,Time[0],Close[0]+0.0005);
}
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---