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

Fw: [amibroker] help with ref()



PureBytes Links

Trading Reference Links

Typo - put () in datenum()
 
======================
 
I gather from your note that "first date in chart" is the first date of the data and not of the visible chart.  If so, give this a shot:
 
setbarsrequired(100000, 0);
y = foreign("XXX", "close");
yclose = valuewhen(datenum() == valuewhen(barindex() == 0, datenum, 1), y, 1);
 
Bill

----- Original Message -----

From: "Waleed Khalil" <waleedkhalil@xxxxxxxxx>
Sent: Friday, April 06, 2007 6:12 PM
Subject: Re: [amibroker] help with ref()

> Thanks Ara for the fast reply
> i did that also and i still get zero
> the issue is that i need to get the first date in the chart and then get
> the close for the same day for the Foreign stock
>
> SetBarsRequired(100000, 0);
> case30=Foreign ("case30","close ");
> Case30basevalue= Ref (Foreign ("case30","close "), -BarCount);
> Title = "  BarCount = " + BarCount + "Case30basevalue =" +Case30basevalue  ;
>
>
>
> Ara Kaloustian wrote:
>>
>> Barcount is the last available data loaded, so when you ask for data
>> prior
>> to Barcount bars, there is no data.
>>
>> If you want to load entire data set use
>>
>> SetBarsRequired(1000000,0); at top of program and use a different way of
>> asking for data other than Barcount bars ago
>>
>> This may slow down program.
>>
>> ----- Original Message -----
>> From: "Waleed Khalil" <
waleedkhalil@xxxxxxxxx
>> <
mailto:waleedkhalil%40gawab.com>>
>> To: <
amibroker@xxxxxxxxxxxxxxx <mailto:amibroker%40yahoogroups.com>>
>> Sent: Friday, April 06, 2007 2:27 PM
>> Subject: [amibroker] help with ref()
>>
>> > Hi all
>> > Please tell me why the Ref function does not get data more that 260 days
>> > ago,
>> > it returns zero for any period more than 260 days ago
>> >
>> > _SECTION_BEGIN("stockovercase");
>> > case30=Foreign ("case30","close ");
>> > Case30basevalue= Ref (Foreign ("case30","close "), -BarCount);
>> > Title = " BarCount = " + BarCount + "Case30basevalue ="
>> +Case30basevalue
>> > ;
>> > _SECTION_END();
>> >
>> >
>> >
>> > 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/ <http://www.amibroker.com/devlog/>
>> >
>> > For other support material please check also:
>> >
http://www.amibroker.com/support.html
>> <
http://www.amibroker.com/support.html>
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>>
>> 
>
>
>
> 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/

>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.26/746 - Release Date: 4/4/2007 1:09 PM
>
>
__._,_.___

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

__,_._,___