ATM_ShowTime

Author: Copyright � 2006 Accrete LLC.
ATM_ShowTime
Price Data Components
Series array that contains open time of each bar
0 Views
0 Downloads
0 Favorites
ATM_ShowTime
//+------------------------------------------------------------------+
//| ShowTime.mq4  Place in emplty chart to show time to candle close |
//| You may also wish to make a template with all parameters set so  |
//| all colors are same as background. So as to only show clock.     |
//|         Copyright © 2006 Accrete LLC. www.accrete.com            |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2006 Accrete LLC."
#property link      "http://www.accrete.com"

#property indicator_separate_window

double s1[];

string  ln_txt[13],        
        buff_str = "";
        
int     
        nTime = 0,
        CurPeriod = 0,
        nDigits = 0,
        i = 0;

int init()
  {
IndicatorShortName("ATM_ShowTime");

    return(0);
  }
    
 int start()
 {  
	double g;
   int m,s,k;
   m=Time[0]+Period()*60-CurTime();
   g=m/60.0;
   s=m%60;
   m=(m-m%60)/60;

   g=NormalizeDouble(g,1);
   for (k=1;k<=Bars-1;k++) s1[k]=0.0000001;
   for (k=1;k<=2;k++) s1[k]=g;

  
    ObjectCreate("lab6", OBJ_LABEL, WindowFind("ATM_ShowTime"), 0, 0);
        ObjectSetText("lab6",DoubleToStr(m,-4),20, "Arial Bold", Aqua);
        ObjectSet("lab6", OBJPROP_CORNER, 0);
        ObjectSet("lab6", OBJPROP_XDISTANCE, 90);
        ObjectSet("lab6", OBJPROP_YDISTANCE, 20);

    ObjectCreate("lab8", OBJ_LABEL, WindowFind("ATM_ShowTime"), 0, 0);
        ObjectSetText("lab8","Candle CLose in ", 9, "Arial Bold", Black);
        ObjectSet("lab8", OBJPROP_CORNER, 0);
        ObjectSet("lab8", OBJPROP_XDISTANCE, 65);
        ObjectSet("lab8", OBJPROP_YDISTANCE, 0);     
        
    ObjectCreate("lab9", OBJ_LABEL, WindowFind("ATM_ShowTime"), 0, 0);
        ObjectSetText("lab9"," Minutes", 9, "Arial Bold", Black);
        ObjectSet("lab9", OBJPROP_CORNER, 0);
        ObjectSet("lab9", OBJPROP_XDISTANCE, 85);
        ObjectSet("lab9", OBJPROP_YDISTANCE, 50);
        
//End Data Window     

//---- End Of Program
  return(0);
  }
//+------------------------------------------------------------------+

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