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

Re: [amibroker] wait till last few seconds of the bar



PureBytes Links

Trading Reference Links

hi,
 
I use some code that Herman posted in the UKB.
 
I put it in a function:
 
function secondsLeftOnBar_func()
{
 
 Time = Now( 4 );
 Seconds = int( Time % 100 );
 Minutes = int( Time / 100 % 100 );
 Hours = int( Time / 10000 % 100 );
 SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );
 
 TimeFrame = Interval();
 Newperiod = SecondNum % TimeFrame == 0;
 SecsLeft = SecondNum - int( SecondNum / TimeFrame ) * TimeFrame;
 SecsToGo = TimeFrame - SecsLeft;
 
 return SecsToGo;
 
}
I your code you then simply call for this function like:
 
SecsToGo = ceil(secondsLeftOnBar_func());
 
Note: it will use the timeframe you have in your chart,
 
regards, Ed
 
 

 
----- Original Message -----
Sent: Friday, August 22, 2008 10:46 PM
Subject: [amibroker] wait till last few seconds of the bar

i run scans on 5 minute bars. however i want to report certain results
close to the end of the bar time. i came accross this formula that will
ensure that i will report only on complted bars. is there a way to make
it report when the seconds left to completion is say 30 seconds. any
ideas is appreciated.

barcomplete = BarIndex() < LastValue(BarIndex());

__._,_.___

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




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

__,_._,___