Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

 
 
Thread Tools
 
Old 09-05-2006, 02:19 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 723
Kalenzo is on a distinguished road
Date format function

Hi Folks!
When I was debugging my EA orders I wanted to print when they was created. But the OrderOpenTime() function returns timestamp number so it is hard to read the date from it without any tool or conversion. So I made a nice function that convert eg. 12313132 into a string like 2006.03.12 12:33 so it can be read very easy.

Here it is:
Code:
string dateFormat(int timestamp)
{
   string m,d,h,mi;
   
   int month = TimeMonth(timestamp);
   int day = TimeDay(timestamp);
   int hour = TimeHour(timestamp);
   int minute = TimeMinute(timestamp);
   
   if(month<10)
   m = "0"+month;
   else
   m = month;
   
   if(day<10)
   d = "0"+day;
   else
   d = day;
   
   if(hour<10)
   h = "0"+hour;
   else
   h = hour;
   
   if(minute<10)
   mi = "0"+minute;
   else
   mi = minute;
   
   
   return(StringConcatenate(TimeYear(timestamp),".",m,".",d," ",h,":",mi));
}
U can use it as u want hope it will be helpfull for someone.
Cheers

Kalenzo
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 09-05-2006, 02:22 PM
phoenix's Avatar
Senior Member
 
Join Date: May 2006
Posts: 319
phoenix is on a distinguished road
but .. what about TimeToStr() function?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 09-05-2006, 02:26 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 723
Kalenzo is on a distinguished road
Quote:
Originally Posted by phoenix
but .. what about TimeToStr() function?
U right, sometimes I'm missing something which goes without saying...
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 12-06-2008, 05:33 AM
Junior Member
 
Join Date: Apr 2007
Posts: 3
benjie is on a distinguished road
date and time switch on off

hi,

can you give me sample script or EA to start EA on monday set time and close friday set time.

TQ
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 

Bookmarks
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EA expiration date jyrik Expert Advisors - Metatrader 4 6 04-12-2007 05:32 PM
How to put the Expiry date in EA MACD Expert Advisors - Metatrader 4 1 01-26-2007 01:59 PM
Need help - importing data in txt format wazzon Metatrader 4 1 05-25-2006 04:34 PM


All times are GMT. The time now is 12:50 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.