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

[amibroker] Last Visible Date code



PureBytes Links

Trading Reference Links

Hi

The following code was provided to this board by William Peters on 26
Sept 2005:

function LastVisibleDate()
{
Version(4.70);
DateArray = DateNum();
Lvbindex = Status( "lastvisiblebarindex" );
Lbindex = BarCount - 1;

if ( Lvbindex > Lbindex )
Lvb = DateArray[ Lbindex ];
else
Lvb = DateArray[ Status( "lastvisiblebar" ) ] - 1;

DayNm = round( frac( Lvb / 100 ) * 100 );
MthNm = round( frac( Lvb / 10000 ) * 100 );
YrNm = int( Lvb / 10000 ) + 1900;

return NumToStr( DayNm, 1.0 ) + "/" + NumToStr( MthNm, 1.0 ) + "/" +
NumToStr( YrNm, 1.0, False );
}

On running it I get an error "subscript out of range...0 -
(barcount-1)" on "Status( "lastvisiblebar" )". (It appears to evaluate
to -1).

Any ideas anyone?

TIA
Conrad

 



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
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/