Price Data Components
Indicators Used
1
Views
0
Downloads
0
Favorites
#00CURRENT PRICE1
//+------------------------------------------------------------------+
//| CURRENT PRICE.mq4 |
//| cja |
//| |
//+------------------------------------------------------------------+
#property copyright "Original code supplied by Kalenzo"
#property link "bartlomiej.gorski@gmail.com"
#property link "Modified code by cja"
#property link "Modified code by xard777"
//Helps to see the current price in a separate window when price is
//covered by labels from pivot or murrey math lines
#property indicator_separate_window
#property indicator_buffers 1
double s1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//---- indicators
IndicatorShortName(" ");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
// this will write ema value, but it can be any value that u want
// for eg. iCustom value or value that u got from object like muray math line
double myFirstValue = iMA(Symbol(),0,1,0,MODE_EMA,PRICE_CLOSE,0);
double i;
int m,s,k;
m=Time[0]+Period()*60-CurTime();
i=m/60.0;
s=m%60;
m=(m-m%60)/60;
//Comment(m + " minutes " + s + " seconds left to bar end");
i=NormalizeDouble(i,1);
for (k=1;k<=Bars-1;k++) s1[k]=0.0000001;
for (k=1;k<=2;k++) s1[k]=i;
//(m,Digits-4)
ObjectCreate("MyLabel30", OBJ_LABEL, WindowFind("SDX"), 0, 0);
ObjectSetText("MyLabel30",DoubleToStr(myFirstValue,Digits),11, "Arial Black", Red);
ObjectSet("MyLabel30", OBJPROP_CORNER, 0);
ObjectSet("MyLabel30", OBJPROP_XDISTANCE, 580);
ObjectSet("MyLabel30", OBJPROP_YDISTANCE, 2);
ObjectCreate("MyLabel31", OBJ_LABEL, WindowFind("SDX"), 0, 0);
ObjectSetText("MyLabel31",DoubleToStr(m,-4),11, "Arial Black", LawnGreen);
ObjectSet("MyLabel31", OBJPROP_CORNER, 0);
ObjectSet("MyLabel31", OBJPROP_XDISTANCE, 700);
ObjectSet("MyLabel31", OBJPROP_YDISTANCE, 1);
ObjectCreate("MyLabel32", OBJ_LABEL, WindowFind("SDX"), 0, 0);
ObjectSetText("MyLabel32",DoubleToStr(s,-4), 11, "Arial Black", LawnGreen);
ObjectSet("MyLabel32", OBJPROP_CORNER, 0);
ObjectSet("MyLabel32", OBJPROP_XDISTANCE, 793);
ObjectSet("MyLabel32", OBJPROP_YDISTANCE, 2);
ObjectCreate("MyLabel33", OBJ_LABEL, WindowFind("SDX"), 0, 0);
ObjectSetText("MyLabel33","Mins ", 10, "Arial Black", LightSkyBlue);
ObjectSet("MyLabel33", OBJPROP_CORNER, 0);
ObjectSet("MyLabel33", OBJPROP_XDISTANCE, 660);
ObjectSet("MyLabel33", OBJPROP_YDISTANCE, 3);
ObjectCreate("MyLabel34", OBJ_LABEL, WindowFind("SDX"), 0, 0);
ObjectSetText("MyLabel34","Secs", 10, "Arial Black", LightSkyBlue);
ObjectSet("MyLabel34", OBJPROP_CORNER, 0);
ObjectSet("MyLabel34", OBJPROP_XDISTANCE, 750);
ObjectSet("MyLabel34", OBJPROP_YDISTANCE, 3);
ObjectCreate("MyLabel35", OBJ_LABEL, WindowFind("SDX"), 0, 0);
ObjectSetText("MyLabel35","Price", 10, "Arial Black", LightSkyBlue);
ObjectSet("MyLabel35", OBJPROP_CORNER, 0);
ObjectSet("MyLabel35", OBJPROP_XDISTANCE, 530);
ObjectSet("MyLabel35", OBJPROP_YDISTANCE, 3);
//----
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
---