Kamis, 03 Agustus 2017

[smf_addin] Digest Number 4110

8 Messages

Digest #4110
1a
Re: Broker login by buckleca
1b
Re: Broker login by buckleca
1c
Re: Broker login by buckleca
1d
Re: Broker login by "Randy Harmelink" rharmelink
1e
Re: Broker login by buckleca
1f
Re: Broker login by "Randy Harmelink" rharmelink

Messages

Wed Aug 2, 2017 8:39 pm (PDT) . Posted by:

buckleca

Tried the smfForceRecalculation macro and get the same result.

Used smfGetTagContent() and ran debug. Noted that it runs RCHGetURLData1 (XMLHTTP Get) version and this returns an "error"

Changed the pUseIE value to 1 and it ran the IE object (RCHGetURLData2) and the function returned the correct value.

I'll look in the documentation and see if this value can be passed in the function call - but assume that the XMLHTTP Get version can't load the logged in page.

I'm not that knowledgeable on VBA, so not sure if I'm missing something.

Thanks again.

Wed Aug 2, 2017 8:46 pm (PDT) . Posted by:

buckleca

I see it in the documentation - so now calling it with type 1 and it's working.

Type = An optional integer value to determine the type of Internet request to make. Defaults to 0. For now, other values are experimental:

0 = XMLHTTP "Get" Request
1 = IE Object Request
2 = HTMLDocument Request
3 = XMLHTTP "Post" Request


Thu Aug 3, 2017 12:15 pm (PDT) . Posted by:

buckleca

Hi Randy. I've got this half working. When I run this on a number of rows with different symbols, I get inconsistent results:

=smfGetTagContent($A$15,$B22,$C22,$A22,,,,,,1)


I run the smfForceRecalculation macro and sometimes row 1 returns the correct results and row 2 returns "error". Row 3 may be fine.

Run the macro again and row 1 might be an error and row 2 and 3 fine.

Do you think this is because I'm using the IE option with the function and it's timing out?

I was also wondering if my VBA code uses XMLHTTP to log into the website initially, the the IE option for the function wouldn't be necessary?

Thanks

Thu Aug 3, 2017 1:52 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

It shouldn't be because something is timing out, as the add-in saves a copy
of the web page and then extracts the data from the saved copy of the web
page. So if all three rows are coming from the same saved copy of the web
page, something is wonky about the web page.

I would suspect your search parameters aren't positioning you where you
expect them to.

One reason I abandoned everything other than XMLHTTP is that the other
processing is inconsistent between versions of IE and versions of EXCEL and
versions of the O/S.

I wouldn't think you could use XMLHTTP to log in. The log in process
usually requires creating a cookie, which usually involved some kind of
script. XMLHTTP just retrieves source code. It doesn't do any scripting at
all.

On Thu, Aug 3, 2017 at 12:15 PM, buckleca@
​...
wrote:

>
> Hi Randy. I've got this half working. When I run this on a number of rows
> with different symbols, I get inconsistent results:
>
> =smfGetTagContent($A$15,$B22,$C22,$A22,,,,,,1)
>
> I run the smfForceRecalculation macro and sometimes row 1 returns the
> correct results and row 2 returns "error". Row 3 may be fine.
>
> Run the macro again and row 1 might be an error and row 2 and 3 fine.
>
> Do you think this is because I'm using the IE option with the function and
> it's timing out?
>
> I was also wondering if my VBA code uses XMLHTTP to log into the website
> initially, the the IE option for the function wouldn't be necessary?
>
>

Thu Aug 3, 2017 3:12 pm (PDT) . Posted by:

buckleca

Thanks again Randy for all your help. It's hard to show you the issue when the website is behind a pay wall.

What's interesting is that when I log in and select a quote, I can log out and still get the quotes. Via the IE browser in Excel without fail and only randomly when I use the functions (after recalculating with the macro).

Whenever I switch off using IE with the function it always returns errors. I assume that the only way to use the function and it works partly with the IE option.

I'll try running the recalc via debug and see if there's any clue as to why some fail. Would it be a timing issue if it works while stepping through debug?

Thu Aug 3, 2017 3:41 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

There shouldn't be a timing issue, because it saves a copy of the web page
before extracting any data from it. You could spend some time in the
examination worksheet to see what all of the content looks like.

On Thu, Aug 3, 2017 at 3:12 PM, buckleca@
​...
wrote:

>
> Thanks again Randy for all your help. It's hard to show you the issue when
> the website is behind a pay wall.
>
> What's interesting is that when I log in and select a quote, I can log out
> and still get the quotes. Via the IE browser in Excel without fail and only
> randomly when I use the functions (after recalculating with the macro).
>
> Whenever I switch off using IE with the function it always returns errors.
> I assume that the only way to use the function and it works partly with the
> IE option.
>
> I'll try running the recalc via debug and see if there's any clue as to
> why some fail. Would it be a timing issue if it works while stepping
> through debug?
>
>
>
>
>

Thu Aug 3, 2017 12:54 pm (PDT) . Posted by:

lexstar

I'm just curious, if all I want is the UNADJUSTED OHLC, what parameters would I use?

I try DOHLCVU and only get UNADJUSTED Close, but the OHLC are ADJUSTED.



Thu Aug 3, 2017 2:36 pm (PDT) . Posted by:

"Randy Harmelink" rharmelink

If you want unadjusted O/H/L, you'd need to calculate them yourself,
dividing by the dividend and split adjustment factors.

On Thu, Aug 3, 2017 at 12:54 PM, lexstar@
​...
wrote:

>
> I'm just curious, if all I want is the UNADJUSTED OHLC, what parameters
> would I use?
>
> I try DOHLCVU and only get UNADJUSTED Close, but the OHLC are ADJUSTED.
>
>
For the Add-in, Documentation, Templates, Tips and FAQs, visit http://ogres-crypt.com/SMF

Tidak ada komentar:

Posting Komentar