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

Re: [amibroker] GAT string construction



PureBytes Links

Trading Reference Links

hi,
 
this is how I do these things. Below an example how one could extract the datestring from Now();  I leave the time part for you,
 
rgds, Ed
 
 
ts = Now();

sl =
StrLen
(ts);
strpos =
0
;
cnt =
0
;
for (i=0
; i<sl; i++) {
      
   
if (StrMid(ts,i,1) == "/"
) {
      
      strpos[ cnt ] = i;
      cnt = cnt +
1
;
            
   }
         
}

// extract month

sp1 = strpos[
0
];
mt =
StrMid(ts,0
,sp1);
if (StrLen(mt) == 1
) {
   mt =
"0"
+ mt;
}
// extract day

sp2 = strpos[
1
];
dy =
StrMid(ts,sp1 + 1, sp2 - sp1 - 1
);
if (StrLen(dy) == 1
) {
   dy =
"0"
+ dy;
}   
// extract year

sp3 = strpos[
2
];
yr =
StrMid(ts,sp2 + 1,4
);

// construct date string

dat1 = yr + mt + dy;   
"date string: "
+ dat1;

 
 
 
 
 
 
----- Original Message -----
From: eric tao
Sent: Thursday, June 14, 2007 4:02 AM
Subject: [amibroker] GAT string construction

Hi Guys,

I'm trying to place a "GAT" ( GoodAfterTime ) order using IB controller.
Is there a good way to construct a current time string in "YYYYMMDD
HH:MM:SS" format? as in "20070614 18:00:00"?

Thank you
Eric

__._,_.___

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

__,_._,___