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

Re: [amibroker] Time left in bar



PureBytes Links

Trading Reference Links

Ara,
 
Theoretically Data manager synchronizes time automatically.
 
The other reason may be that security you are checking does not trade very frequently.
Then new bar won't be created until new trade appears in given (new) time period.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
Sent: Friday, September 23, 2005 12:35 AM
Subject: Re: [amibroker] Time left in bar

Tomasz,
 
The preferencces are set correctly to "END time of interval".
 
I am using eSignal... Is ther a way to synchronize exchange time an PC time?
 
Thanks
 
Ara
----- Original Message -----
Sent: Thursday, September 22, 2005 3:21 PM
Subject: Re: [amibroker] Time left in bar

Ara,
 
This actually depends on settings and data source you are using.
If time-compressed bars are considered,
when you want to use such approach you need to go to
Tools->Preferences->Intraday
and set
"END time of interval".
Otherwise Now() may be greater than timenum.
If base time interval is considered - this depends on data source.
Most real time data source timestamp quotes using exchange time
which may be different than your computer's clock.
Some data sources do not timestamp at all (DDE/IB) and then
computer clock is used, and then usually TimeNum represents
the time of last trade (local clock)

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
To: AB-Main
Sent: Friday, September 23, 2005 12:01 AM
Subject: [amibroker] Time left in bar

Recently I posted my "imperfect" code... someone else posted code for same function... both seem to have similar problems.

I reviewed my code and reduced it to basics.

Design Concept:  TimeLeftinBar = TimeNum() - Now(4);

If time numbet() is set to display the end of bar time, then Now(4) will always be less the TimeNum() by an amount equal to time left.

Problem:  Time returned by Now(4) is sometimes greater the TimeNum(), sometime by a significant amount. It seems that new bars are not created at the transition of minute bars.

Would someone test the code below to verify my results. Should be tested when RT data is flowing in.  All data will appear in title.

Thanks

Ara

//File: Time Left in Bar

 

PlotOHLC(Open,High,Low,Close,"",colorBlack,styleCandle);

BarTime1 = (LastValue(TimeNum() - Now(4)));

_N(TimeBase = Interval(2));

 

_N(StrBarTime = NumToStr(BarTime1,1.0,False));

BT_Length = StrLen(StrBarTime);

//Format time left for display

_N(TimeLeft = WriteIf(BT_Length==1,"0:0"+StrBarTime,WriteIf(BT_Length==2,"0:"+StrBarTime,

WriteIf(BT_Length==3,StrLeft(StrBarTime,1)+":"+StrRight(StrBarTime,2),

StrLeft(StrBarTime,2)+":"+StrRight(StrBarTime,2)))));

 

 

_N(Title = "Time Left Test - Interval: " + TimeBase + " TimeNum: " + WriteVal(TimeNum(),1.0)

+ " Now: " + Now(4) + " TimeLeft: " + TimeLeft);



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 other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS