Selasa, 03 Oktober 2017

[smf_addin] Digest Number 4164

13 Messages

Digest #4164
1a
gurufocus by "Alexei Alex"
1b
Re: gurufocus by "Randy Harmelink" rharmelink
2b
Re: Elements 1285 & 1290 and Earnings by "Randy Harmelink" rharmelink
2d
Re: Elements 1285 & 1290 and Earnings by "Randy Harmelink" rharmelink
2f
Re: Elements 1285 & 1290 and Earnings by "Randy Harmelink" rharmelink
2h
Re: Elements 1285 & 1290 and Earnings by "Randy Harmelink" rharmelink
2j
Re: Elements 1285 & 1290 and Earnings by "Randy Harmelink" rharmelink

Messages

Tue Oct 3, 2017 9:46 am (PDT) . Posted by:

"Alexei Alex"

Dear,

how to get data from premium gurufocus zone?

I have guru login and already Log On via Excel
but don't see the old data.

[image: Inline image 1]

and other question how to simply change . to , due to my regional settings
for digits with ,

thank you
Alex

Tue Oct 3, 2017 10:35 am (PDT) . Posted by:

"Randy Harmelink" rharmelink

Hmm. Working here.

Did you log on after first trying to get the data? If so, you need to run
the smfForceRecalculation to purge the previously retrieved (pre-login) web
page.

Regional settings are part of the Windows settings, under Region and
Settings. Just ask Cortana.

On Tue, Oct 3, 2017 at 9:00 AM, Alexei Alex alexis6@
​....
wrote:

>
> how to get data from premium gurufocus zone?
>
> I have guru login and already Log On via Excel
> but don't see the old data.
>
> [image: Inline image 1]
>
> and other question how to simply change . to , due to my regional settings
> for digits with ,
>
>

Tue Oct 3, 2017 10:34 am (PDT) . Posted by:

ssztaba

Dear Randy,

A question regarding the correct element # to use to get the next Earnings Date for a stock.

I am using the current SMF file (just downloaded it) with the current RCH Definitions. When I use RCHGetElementNumber("AAPL";,1285) I get a range of dates as the answer. I would prefer to get just one date rather than a range.

An earlier version of the RCH Definitions (2017-05-02) had an element 1290 that would give just one earnings date -- e.g. giving 10/18/17 as the date for AAPL. That 2017-05-02 definitions file also had the 1285 element which gave the range of dates

When I use element 1290 with the lastest smf download I get an error using element 1290, but I do get the range (as above) when using element 1285.

Is there an element in the current RCH definitions file that will give just one date (as in the 2017-05-02 version) ??

Thanks

Stan

Tue Oct 3, 2017 12:36 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

The add-in is just returning what the data source is providing. While you
might want a single date, others might not. You can always do the
extraction yourself. For example, to always get the first (or only) date,
either:

=smfStrExtr(RCHGetElementNumber($C3,1285)&"-","~","-")
=smfWord(RCHGetElementNumber($C3,1285)&"-",1,"-")

Element #1290 works fine for me. What definition do you have for it?

=RCHGetElementNumber("Definition",1290)

I get:

ZacksEA;Quarterly Earnings -- Reported Date --
1;=SUBSTITUTE(smfWord(smfWord(smfStrExtr(RCHGetWebData("
https://www.zacks.com/stock/research/~~~~~/earnings-announcements","document.obj_data
= {"),": ",":"),3,"["),1,","),"""","")

On Tue, Oct 3, 2017 at 10:34 AM, ssztaba@
​...
wrote:

>
> A question regarding the correct element # to use to get the next Earnings
> Date for a stock.
>
> I am using the current SMF file (just downloaded it) with the current RCH
> Definitions. When I use
> ​​
> RCHGetElementNumber("AAPL";,1285) I get a range of dates as the answer.
> I would prefer to get just one date rather than a range.
>
> An earlier version of the RCH Definitions (2017-05-02) had an element 1290
> that would give just one earnings date -- e.g. giving 10/18/17 as the date
> for AAPL. That 2017-05-02 definitions file also had the 1285 element
> which gave the range of dates
>
> When I use element 1290 with the lastest smf download I get an error using
> element 1290, but I do get the range (as above) when using element 1285.
>
> Is there an element in the current RCH definitions file that will give
> just one date (as in the 2017-05-02 version) ??
>
>

Tue Oct 3, 2017 12:50 pm (PDT) . Posted by:

ssztaba

I get the exact same definition for 1290 as you do:
ZacksEA;Quarterly Earnings -- Reported Date -- 1;=SUBSTITUTE(smfWord(smfWord(smfStrExtr(RCHGetWebData("https://www.zacks.com/stock/research/~~~~~/earnings-announcements","document.obj_data = {"),": ",":"),3,"["),1,","),"""","")


But, when I do a =RCHGetElementNumber("AAPL",1290) I get "Error"

Tue Oct 3, 2017 2:03 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Hmm. Do you get data with:

=RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements",,100)
=RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements","document.obj_data
= {",200)
=RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements
","""$1.87""",100)
=RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements
","""10/24/2017""",100)

What happens if you visit the above URL in IE or your browser (or in the
old EXCEL Web Query dialog, alt+d+d+w)?

On Tue, Oct 3, 2017 at 12:50 PM, ssztaba@
​...
wrote:

>
> I get the exact same definition for 1290 as you do:
> ZacksEA;Quarterly Earnings -- Reported Date --
> 1;=SUBSTITUTE(smfWord(smfWord(smfStrExtr(
> ​​
> RCHGetWebData("https://www.zacks.com/stock/research/~~~~~/earnings-
> announcements","document.obj_data = {"),": ",":"),3,"["),1,","),"""","")
>
> But, when I do a =RCHGetElementNumber("AAPL",1290) I get "Error"
>
>
>

Tue Oct 3, 2017 2:37 pm (PDT) . Posted by:

ssztaba

Hmm. Do you get data with:


=RCHGetWebData("https://www.zacks.com/stock/research/AAPL/earnings-announcements https://www.zacks.com/stock/research/AAPL/earnings-announcements",,100)

=RCHGetWebData("https://www.zacks.com/stock/research/AAPL/earnings-announcements https://www.zacks.com/stock/research/AAPL/earnings-announcements","document.obj_data = {",200)

=RCHGetWebData("https://www.zacks.com/stock/research/AAPL/earnings-announcements https://www.zacks.com/stock/research/AAPL/earnings-announcements","""$1.87""",100)

=RCHGetWebData("https://www.zacks.com/stock/research/AAPL/earnings-announcements https://www.zacks.com/stock/research/AAPL/earnings-announcements","""10/24/2017""",100)



What happens if you visit the above URL in IE or your browser (or in the old EXCEL Web Query dialog, alt+d+d+w)?


-------------------
The first line gets me:


=RCHGetWebData("https://www.zacks.com/stock/research/AAPL/earnings-announcements",,100)

The 2nd line gets me:
document.obj_data = { "earnings_announcements_earnings_table" : [ [ "10/24/2017", "9/2017", "$1.87", "--", "--", "--", "--" ] , [ "8/1/2017", "6/2017", "$1.57", "$1.67", "<div clas
The 3rd line gets me:
"$1.87", "--", "--", "--", "--" ] , [ "8/1/2017", "6/2017", "$1.57", "$1.67", "<div class=\"right p
The 4th line gets me:
"10/24/2017", "9/2017", "$1.87", "--", "--", "--", "--" ] , [ "8/1/2017", "6/2017", "$1.57", "$1.67
I have no problem going to the Zacks URL in my browser (Firefox).

Using the Excel Web Query dialog (I'm using Excel 2002) gets me to Internet access. When I clear the MSN and Dell links I'm left with a blank URL line. Entering the Zacks URL I do get to the Zacks page, but I'm given a script error on various Zacks pages -- the first of which is on the URL https://staticx.zacks.com/min/z2-min.js https://staticx.zacks.com/min/z2-min.js

Tue Oct 3, 2017 4:07 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

That's very strange. I was expecting you to get an error on at least one of
those four functions. It looks like everything was coming back OK -- what I
would normally expect to see. So let's walk backward thru the steps of the
element definition.

What do you get with:

=SUBSTITUTE(smfWord(smfWord(smfStrExtr(RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements","document.obj_data
= {"),": ",":"),3,"["),1,","),"""","")

=smfWord(smfWord(smfStrExtr(RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements","document.obj_data
= {"),": ",":"),3,"["),1,",")

=smfWord(smfStrExtr(RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements","document.obj_data
= {"),": ",":"),3,"[")

=smfStrExtr(RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements","document.obj_data
= {"),": ",":")

=RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements","document.obj_data
= {",150)

I'm assuming the first one will return "Error", since that is what the
element definition is.

Hmm. Now that I think about it, "Error" wouldn't get returned after those
smfWord() and smfStrExtr() functions are run. They would strip off any
"Error" result returned from RCHGetWebData() and return blanks. If so, that
means something is erroring out before or during the actual Eval() function
in VBA. Those are almost impossible to resolve. One thing that would cause
it is if your "AAPL" string has an unprintable character in it. That would
corrupt the created URL and cause an "Error" to be returned by using
element number 1290.

Do one more for me, and hand-enter it without copying and pasting (which
can sometimes insert invisible characters):

=RCHGetElementNumber("MMM",1290)

Do you have logging on? This is what I see for logging on that last
function invocation:

Time Stamp Duration Called URL
2017-10-03 15:46:11 4.1406
https://www.zacks.com/stock/research/MMM/earnings-announcements

On Tue, Oct 3, 2017 at 2:37 PM, ssztaba@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:

>
> Hmm. Do you get data with:
>
> =RCHGetWebData("https://www.zacks.com/stock/research/AAPL/
> earnings-announcements",,100)
> =RCHGetWebData("https://www.zacks.com/stock/research/AAPL/
> earnings-announcements","document.obj_data = {",200)
> =RCHGetWebData("https://www.zacks.com/stock/research/AAPL/
> earnings-announcements","""$1.87""",100)
> =RCHGetWebData("https://www.zacks.com/stock/research/AAPL/
> earnings-announcements","""10/24/2017""",100)
>
> What happens if you visit the above URL in IE or your browser (or in the
> old EXCEL Web Query dialog, alt+d+d+w)?
>
> -------------------
> The first line gets me:
>
> =RCHGetWebData("https://www.zacks.com/stock/research/AAPL/
> earnings-announcements",,100)
>
> The 2nd line gets me:
> document.obj_data = { "earnings_announcements_earnings_table" :
> [ [ "10/24/2017", "9/2017", "$1.87", "--", "--", "--", "--" ] , [
> "8/1/2017", "6/2017", "$1.57", "$1.67", "<div clas
> The 3rd line gets me:
> "$1.87", "--", "--", "--", "--" ] , [ "8/1/2017", "6/2017", "$1.57",
> "$1.67", "<div class=\"right p
> The 4th line gets me:
> "10/24/2017", "9/2017", "$1.87", "--", "--", "--", "--" ] , [
> "8/1/2017", "6/2017", "$1.57", "$1.67
> I have no problem going to the Zacks URL in my browser (Firefox).
>
> Using the Excel Web Query dialog (I'm using Excel 2002) gets me to
> Internet access. When I clear the MSN and Dell links I'm left with a
> blank URL line. Entering the Zacks URL I do get to the Zacks page, but I'm
> given a script error on various Zacks pages -- the first of which is on the
> URL https://staticx.zacks.com/min/z2-min.js
>
>

Tue Oct 3, 2017 4:20 pm (PDT) . Posted by:

ssztaba

=RCHGetElementNumber("MMM",1290)



Do you have logging on? This is what I see for logging on that last function invocation:


Time Stamp Duration Called URL 2017-10-03 15:46:11 4.1406 https://www.zacks.com/stock/research/MMM/earnings-announcements https://www.zacks.com/stock/research/MMM/earnings-announcements


------------------------


Hand entered =RCHGetElementNumber ("MMM",1290) gives me "Error"


I don't understand what "logging on" is. But clicking on the URL in the box above gets me to the Zacks page for MMM earnings


Tue Oct 3, 2017 4:48 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

Try this:

1. Exit and restart EXCEL.
2. Create a new worksheet.
3. Right click, click on "SMF" menu option, then on "Logging", then on
"Enable".
4. Cut and paste this:

=RCHGetWebData("
https://www.zacks.com/stock/research/AAPL/earnings-announcements",,100)

5. Then hand-enter this again:

=RCHGetElementNumber("MMM",1290)

6. Right click, click on "SMF" menu option, then on "Logging", then on
"Open Log File".

You should be looking at two lines similar to this, one for AAPL and one
for MMM:

Time Stamp Duration Called URL
2017-10-03 15:46:11 4.1406 https://www.zacks.com/stock/
research/MMM/earnings-announcements

I'm mainly curious to see what your URLs there looks like.

You wouldn't happen to be using an older version of EXCEL?

Hmm. I do have a way to check if it's the Eval() function in VBA causing
the error.

Enter this string (not a formula, since there is no leading equal sign)
into cell D6:

SUBSTITUTE(smfWord(smfWord(smfStrExtr(RCHGetWebData("
https://www.zacks.com/stock/research/~~~~~/earnings-announcements","document.obj_data
= {"),": ",":"),3,"["),1,","),"""","")

Then try this function (this is more or less what the RCHGetElementNumber()
function is doing):

=smfEval(SUBSTITUTE(D6,"~~~~~","MCD"))

For me, it returns:

10/24/2017

If the Eval() function is the problem, you should get some type of error.
On my version of EXCEL, if that string in cell D6 is over 255 bytes long,
the smfEval() function returns #VALUE!. But I think the length limit was
less on older versions of EXCEL...

On Tue, Oct 3, 2017 at 4:20 PM, ssztaba@
​...
wrote:

>
> I don't understand what "logging on" is. But clicking on the URL in the
> box above gets me to the Zacks page for MMM earnings
>
>

Tue Oct 3, 2017 5:07 pm (PDT) . Posted by:

ssztaba

You should be looking at two lines similar to this, one for AAPL and one for MMM:


Time Stamp Duration Called URL 2017-10-03 15:46:11 4.1406 https://www.zacks.com/stock/ research/MMM/earnings- announcements https://www.zacks.com/stock/research/MMM/earnings-announcements


I'm mainly curious to see what your URLs there looks like.


You wouldn't happen to be using an older version of EXCEL?


-----------------------
2017-10-03 19:57:44 0.6172 https://www.zacks.com/stock/research/AAPL/earnings-announcements 2017-10-03 19:58:59 1.0625 https://www.zacks.com/stock/research/MMM/earnings-announcements






My version of Excel is 2002


----------------------
=smfEval(SUBSTITUTE(D6,"~~~~~","MCD"))



For me, it returns:


10/24/2017

----------------------------


Running the
=smfEval(SUBSTITUTE(D6,"~~~~~","MCD")) gives me a #VALUE error



---------------------



If the Eval() function is the problem, you should get some type of error. On my version of EXCEL, if that string in cell D6 is over 255 bytes long, the smfEval() function returns #VALUE!. But I think the length limit was less on older versions of EXCEL...


Doing a =LEN(D6) gives me 177








Tue Oct 3, 2017 5:50 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

I'm sure it's your version of EXCEL. I think EXCEL 2002 had a shorter
string limit for the VBA Evaluate() function. I've needed to trim down
element definitions so that length is under 255 bytes. But that's for more
recent versions of EXCEL.

I couldn't Google documentation of the length that EXCEL 2002 allows, but
you could test it with something like:

C4: =C3+1
D4: =""""&REPT("A",C4)&""""
E4: =smfEval(D4)

Then just copy those down several hundred rows. At some point, the value in
column E should change to #VALUE!. Add 2 to the value that row's column C
(because of the two double quotes in the string) and you'll know the EXCEL
2002 limit. I'm curious what it is. I would suspect 128. Such limitations
are usually based on factors of 2 because it's all based on a binary number
system.

So any element definition formula longer than that length will return
"Error" for EXCEL 2002.

On Tue, Oct 3, 2017 at 5:07 PM, ssztaba@gmail.com [smf_addin] <
smf_addin@yahoogroups.com> wrote:

>
> You should be looking at two lines similar to this, one for AAPL and one
> for MMM:
>
> Time Stamp Duration Called URL
> 2017-10-03 15:46:11 4.1406 https://www.zacks.com/stock/
> research/MMM/earnings- announcements
> <https://www.zacks.com/stock/research/MMM/earnings-announcements>
>
> I'm mainly curious to see what your URLs there looks like.
>
> You wouldn't happen to be using an older version of EXCEL?
>
> -----------------------
> 2017-10-03 19:57:44 0.6172 https://www.zacks.com/stock/
> research/AAPL/earnings-announcements 2017-10-03 19:58:59 1.0625
> https://www.zacks.com/stock/research/MMM/earnings-announcements
>
> My version of Excel is 2002
>
> ----------------------
> =smfEval(SUBSTITUTE(D6,"~~~~~","MCD"))
>
> For me, it returns:
>
> 10/24/2017
> ----------------------------
>
> Running the
> =smfEval(SUBSTITUTE(D6,"~~~~~","MCD")) gives me a #VALUE error
>
> ---------------------
>
>
> If the Eval() function is the problem, you should get some type of error.
> On my version of EXCEL, if that string in cell D6 is over 255 bytes long,
> the smfEval() function returns #VALUE!. But I think the length limit was
> less on older versions of EXCEL...
>
> Doing a =LEN(D6) gives me 177
>

Tue Oct 3, 2017 5:57 pm (PDT) . Posted by:

ssztaba

Randy,

I'll check this out tomorrow. Thanks for all your efforts.

Stan
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar