Forex



Go Back   Forex Trading > Discussion Areas > General Discussion
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

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2006, 12:25 AM
Junior Member
 
Join Date: Mar 2006
Posts: 13
theimperialone is on a distinguished road
how to get the real server time or how to tell if the market is open

hi there,

I have a little problem.

my indicator uses the call curtime() to get the server time and also uses LocalTime() to get my time.

PHP Code:
TimeDifference CurTime() - LocalTime(); 
My intention is to use these together to work out the start of the day from my perspective.

Now it works perfectly when the markets are open but when they are closed it does not because CurTime() returns the time of the last tick.

Now I can see two possible solutions to this:

1. is there another call i can make to get the real time of the server? For example....

PHP Code:
TimeDifference GenuineServerTime() - LocalTime(); 
2. can i test to see if the market is open. If it is then use curtime and store off the difference in a GLobal varibale for later reuse if the market is not open:

PHP Code:
if (MarketIsOpen())
{
  
  
TimeDifference CurTime() - LocalTime();
  
GlobalVariableSet("TimeDifference",TimeDifference 
}
else
{
  
TimeDifference GlobalVariableGet("TimeDifference");


Can anyone help me fill in the missing links for either option for me or come up with another suggestion.

thanks
TheImperial1
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!
Reply With Quote
  #2 (permalink)  
Old 06-24-2006, 12:33 AM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 396
elihayun is on a distinguished road
Why not use this function instead


if (IsTradeAllowed())
.....
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!
Reply With Quote
  #3 (permalink)  
Old 06-24-2006, 12:42 AM
Junior Member
 
Join Date: Mar 2006
Posts: 13
theimperialone is on a distinguished road
thanks that seems to work ... apart from when the market is closed will this ever return false?
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!
Reply With Quote
  #4 (permalink)  
Old 06-24-2006, 05:17 AM
elihayun's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 396
elihayun is on a distinguished road
Quote:
Originally Posted by theimperialone
thanks that seems to work ... apart from when the market is closed will this ever return false?
Sorry for my answer. It return true anly when the broker is busy, and not in the weekend. Forget what I just said. dont use it for this purpose
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!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Real Time Currency Correlation Calculator JJLL Indicators - Metatrader 4 9 05-14-2007 02:29 AM
Anybody know the server for stock market? shiningstar Indicators - Metatrader 4 3 05-13-2007 03:28 AM
Too much distance from real price in Open Orders echnaton Metatrader 4 2 02-25-2007 12:05 PM
When Does Market Open? mikejody General Discussion 2 01-01-2007 07:20 PM


All times are GMT. The time now is 02:11 AM.



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