thanks that seems to work ... apart from when the market is closed will this ever return false?
theimperialone:
thanks that seems to work ... apart from when the market is closed will this ever return false?
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
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
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.
TimeDifference = CurTime() - LocalTime();
[/PHP]
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....
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]
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