[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] timer code to reflect time zone



PureBytes Links

Trading Reference Links

hi
 
i'm very new to amibroker and would like to get some advice on time code.
 
this is the afl i have for a countdown timer. I'm in Hong Kong and trading the e-minis. There is a time difference of 12 hours as New York is 12 hours behind Hong Kong time.
How do I modify the code so that my timer displays properly? Currently, it kept showing something like this: 72184s and only the last 3 digits change.
 
Appreciate your help.
thanks,
idu
 

tempnum = Now( 4)-TimeNum() ;

 

TimeRem = Interval() - ((int(tempnum[BarCount - 1] / 100) * 60) + (tempnum[BarCount - 1] - int(tempnum[BarCount - 1] / 100) * 100));

if (TimeRem[BarCount - 1] < 0) TimeRem = 0;

TitleTimeRem = EncodeColor(colorBlueGrey) + "Time Remaining: ";

MinuteVar = int(TimeRem / 60);

SecondsVar = int(frac(TimeRem / 60) * 60);

if (TimeRem[BarCount - 1] > 60)

{

TitleTimeRem = TitleTimeRem + EncodeColor(colorWhite) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar;

}

else if (TimeRem[BarCount - 1] > 20)

{

TitleTimeRem = TitleTimeRem + EncodeColor(colorYellow) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar;

}

else

{

TitleTimeRem = TitleTimeRem + EncodeColor(colorLime) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") + SecondsVar;

}

Title = TitleTimeRem + EncodeColor(colorDarkGreen) ;



No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started. __._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___