CS = what?
CS = what?
Oh, sorry, CS=CandleStick :-)
Try this:
int m,s,k,h; m=Time[0]+Period()*60-TimeCurrent(); s=m%60; m=(m-m%60)/60; if(m>=60) h=m/60; else h=0; k=m-(h*60); Comment( h," hours ",k," minutes ",s," seconds left to end of bar");
Thenks a lot Wackena! Works really great.
Just additional question there is no way to make this countdown automatic? So there is no need to execute script each time to see a progress? Or maybe MT4 has an option of executing scripts every minute or something?
Thenks once again!
Just additional question there is no way to make this countdown automatic? So there is no need to execute script each time to see a progress? Or maybe MT4 has an option of executing scripts every minute or something?
Thenks once again!
Put the code in an indicator
Create new indicator
..
..
start()
{
... insert code
return(0);
}
Create new indicator
..
..
start()
{
... insert code
return(0);
}
Hmm, it looks that I did everything as suggested but no effect.... still no automatic countdown... any idea why?
Try this:
//+------------------------------------------------------------------+ //| Bar Clock.mq4 | //| | //| | //+------------------------------------------------------------------+ #property copyright "" #property link "" #property indicator_chart_window //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { double g; int m,s,k,h; m=Time[0]+Period()*60-TimeCurrent(); g=m/60.0; s=m%60; m=(m-m%60)/60; // Comment( m + " minutes " + s + " seconds left to bar end"); if(m>=60) h=m/60; else h=0; k=m-(h*60); Comment(h," hours ",k," minutes ",s," seconds left to bar end"); //---- //---- return(0); } //+------------------------------------------------------------------+
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks.