Jumat, 14 Agustus 2015

[smf_addin] Digest Number 3487

7 Messages

Digest #3487

Messages

Thu Aug 13, 2015 5:59 am (PDT) . Posted by:

marion_stuchlik

Hi Randy,

I have a suggestion to improve the function RCHGetYahooHistory():

After the lines of code:

sBase = "http://ichart.finance.yahoo.com/table.csv?s="
sURL = sBase & pTicker & _
IIf(pStartMonth = 0, "&a=0", "&a=" & (pStartMonth - 1)) & _
IIf(pStartDay = 0, "&b=1", "&b=" & pStartDay) & _
IIf(pStartYear = 0, "&c=" & iEndYear, "&c=" & pStartYear) & _
IIf(pEndMonth = 0, "", "&d=" & (pEndMonth - 1)) & _
IIf(pEndDay = 0, "", "&e=" & pEndDay) & _
IIf(pEndYear = 0, "", "&f=" & pEndYear) & _
"&g=" & pPeriod & _
"&ignore=.csv"

sqData = RCHGetURLData(sURL)

You can add this:

If sqData = "" Then
sBase = "http://real-chart.finance.yahoo.com/table.csv?s="
sURL = sBase & pTicker & _
IIf(pStartMonth = 0, "&a=0", "&a=" & (pStartMonth - 1)) & _
IIf(pStartDay = 0, "&b=1", "&b=" & pStartDay) & _
IIf(pStartYear = 0, "&c=" & iEndYear, "&c=" & pStartYear) & _
IIf(pEndMonth = 0, "", "&d=" & (pEndMonth - 1)) & _
IIf(pEndDay = 0, "", "&e=" & pEndDay) & _
IIf(pEndYear = 0, "", "&f=" & pEndYear) & _
"&g=" & pPeriod & _
"&ignore=.csv"

sqData = RCHGetURLData(sURL)
End If

Indeed, for some tickers, the historical prices are only available under this URL base http://real-chart.finance.yahoo.com/table.csv?s= http://real-chart.finance.yahoo.com/table.csv?s=

Best regards,

Marion


Thu Aug 13, 2015 6:03 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

Can you give me an example or two of tickers symbols where this behavior
exists?

On Thu, Aug 13, 2015 at 5:59 AM, marion_stuchlik@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:

>
>
> Hi Randy,
>
>
>
> I have a suggestion to improve the function RCHGetYahooHistory():
>
>
>
> *After* the lines of code:
>
>
>
> sBase = "http://ichart.finance.yahoo.com/table.csv?s="
>
> sURL = sBase & pTicker & _
>
> IIf(pStartMonth = 0, "&a=0", "&a=" & (pStartMonth - 1)) & _
>
> IIf(pStartDay = 0, "&b=1", "&b=" & pStartDay) & _
>
> IIf(pStartYear = 0, "&c=" & iEndYear, "&c=" & pStartYear) & _
>
> IIf(pEndMonth = 0, "", "&d=" & (pEndMonth - 1)) & _
>
> IIf(pEndDay = 0, "", "&e=" & pEndDay) & _
>
> IIf(pEndYear = 0, "", "&f=" & pEndYear) & _
>
> "&g=" & pPeriod & _
>
> "&ignore=.csv"
>
>
>
> sqData = RCHGetURLData(sURL)
>
>
>
> You can add this:
>
>
>
> If sqData = "" Then
>
> sBase = "http://real-chart.finance.yahoo.com/table.csv?s="
>
> sURL = sBase & pTicker & _
>
> IIf(pStartMonth = 0, "&a=0", "&a=" & (pStartMonth - 1)) & _
>
> IIf(pStartDay = 0, "&b=1", "&b=" & pStartDay) & _
>
> IIf(pStartYear = 0, "&c=" & iEndYear, "&c=" & pStartYear)
> & _
>
> IIf(pEndMonth = 0, "", "&d=" & (pEndMonth - 1)) & _
>
> IIf(pEndDay = 0, "", "&e=" & pEndDay) & _
>
> IIf(pEndYear = 0, "", "&f=" & pEndYear) & _
>
> "&g=" & pPeriod & _
>
> "&ignore=.csv"
>
>
>
> sqData = RCHGetURLData(sURL)
>
> End If
>
>
>
> Indeed, for some tickers, the historical prices are only available under this
> URL base http://real-chart.finance.yahoo.com/table.csv?s=
>
>
>
>

Thu Aug 13, 2015 6:36 am (PDT) . Posted by:

marion_stuchlik

I have noticed this is the case, among others, for:
BBD-B.TO
0012.HK
BXLT

Thu Aug 13, 2015 8:22 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

All three of those work fine for me right now, without any changes to the
RCHGetYahooHistory() routine...

On Thu, Aug 13, 2015 at 6:28 AM, marion_stuchlik@yahoo.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:

>
> I have noticed this is the case, among others, for:
> BBD-B.TO
> 0012.HK
> BXLT
>
>

Thu Aug 13, 2015 8:17 am (PDT) . Posted by:

"Andy Chan" andy_c_chan

Dear Sir/Madam, I am using the addin to retrieve data for Shanghai Exchange last price but looks like *.SS doesn't quite work. e.g. =RCHGetYahooQuotes("601866.SS","l1*") would not return the last price while this function works for Shenzhen stock exchange ie =RCHGetYahooQuotes("000898.SZ","l1*")
Is it another field name I should be using please?  thanks.  Andy

Thu Aug 13, 2015 8:24 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

Yahoo doesn't provide data on its current quotes CSV file feed for
601866.SS. You can verify this by going to the summary page for that stock
and clicking on the "Download Data" link. That link is the save interface
the RCHGetYahooQuotes() function uses.

On Thu, Aug 13, 2015 at 6:27 AM, Andy Chan andy_c_chan@... wrote:

>
> Dear Sir/Madam, I am using the addin to retrieve data for Shanghai
> Exchange last price but looks like *.SS doesn't quite work.
> e.g. =RCHGetYahooQuotes("601866.SS","l1*") would not return the last price
> while this function works for Shenzhen stock exchange
> ie =RCHGetYahooQuotes("000898.SZ","l1*")
>
> Is it another field name I should be using please? thanks. Andy
>

Thu Aug 13, 2015 8:19 am (PDT) . Posted by:

andy_c_chan

that's because 000001 is a Shenzhen stock exchange stock. try 000001.SZ, that should work. both Shanghai exchange quotes are not retrievable. those starts with 6*****.SS. any idea?
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Poskan Komentar