Size:
Color:
I got it done earlier today after I had noticed
your previous post in another thread. After pasting the code, check
System.Xml in Strategy's References dialog:
CODE:
Please log in to see this code.
Note how it caches data in Wealth-Lab's global memory to speed up execution by avoiding repeated web requests.
Size:
Color:
Thanks. I guess previous code from Yahoo scraping did the trick.
I may want to pick another data from this table in the future so can you explain about how this part? (I don't know html coding or about HtmlAgilityPack.)
CODE:
Please log in to see this code.
When I opened the html source code, 'mainRow' showed up in 20 different rows and I can't find out why 8th row was used. If there was a reference to "Financing Activities" table, then 8th row would be correct but I don't see it in the code.
Size:
Color:
Sorry but teaching XPath and web developer tools goes beyond the quick help I intended to provide.
Size:
Color:
Ok. Can you link some reference so I may teach myself?
Size:
Color:
If I had references I'd give them but I learn these things (XPath, DOM, HTML, JSON, libraries for scraping...) here and there. Pointers are all around in Google search.
Size:
Color:
1. I was testing the above code and the symbols CVX and GE returns a value of 0 since FCF is negative. Marketwatch.com formats the negative value in parentheses rather than as a negative sign.
2. For some strange reason, symbols AMZN and VZ returns a value of -1 even though marketwatch.com shows them as positive and negative FCF respectively.
Size:
Color:
EDITED 12/04/2020 Fixed code broken due to changed HTML layoutGood catch, let's fix the parsing routine. Firstly I expected
NumberStyles.AllowParentheses to handle numbers like "(460M)" but for some reason it doesn't. Probably this number format isn't built-in. Therefore the fix below is not elegant but works for me.
To clear global memory from -1s and 0s from the previous runs, uncomment ClearGlobals and do an Execute once, then comment ClearGlobals out and compile. Or copy/paste and restart WLP.
CODE:
Please log in to see this code.
P.S. Perhaps an easier approach would be to replace "(" with a "-" and trim ")" but this occurred to me only later.
Size:
Color: