Compare commits

...
2 Commits
Author SHA1 Message Date
cmallwitz aa20845ae4 Fix yield for US mutuals and EFTs 2021-06-08 17:29:47 +01:00
cmallwitz 7fccc7c0ad Fix issue with FT avg vol 2021-05-19 21:44:06 +01:00
5 changed files with 10 additions and 3 deletions
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -235,7 +235,7 @@ class FT(BaseClient):
tick[Datacode.PREV_CLOSE] = self.save_wrapper(
lambda: float(html.unescape(match.group(1)).replace(',', '').strip()))
r = r'<th>\s*Average volume\s*</th><td>\s*([0-9,\.btnm]+)\s*</td>'
r = r'<th>\s*Average volume\s*</th><td>\s*([0-9,\.btnmk]+)\s*</td>'
match = re.compile(r, flags=re.DOTALL).search(text, start)
if match:
tick[Datacode.AVG_DAILY_VOL_3MONTH] = self.save_wrapper(
@@ -251,7 +251,7 @@ class FT(BaseClient):
tick[Datacode.PE_RATIO] = self.save_wrapper(
lambda: float(value))
r = r'<th>\s*Market cap\s*</th><td>\s*([0-9,\.btnm]+)\s*<'
r = r'<th>\s*Market cap\s*</th><td>\s*([0-9,\.btnmk]+)\s*<'
match = re.compile(r, flags=re.DOTALL).search(text, start)
if match:
tick[Datacode.MARKET_CAP] = self.save_wrapper(
+4
View File
@@ -238,6 +238,10 @@ class Yahoo(BaseClient):
if match:
tick[Datacode.CURRENCY] = match.group(1)
# fallback for yield on US mutual funds and ETFs, which is in different field
if not tick[Datacode.DIV_YIELD]:
tick[Datacode.DIV_YIELD] = float(raw(summaryDetail, 'yield'))
name = price['longName'] or price['shortName']
if name:
tick[Datacode.NAME] = html.unescape(str(name))
+1 -1
View File
@@ -14,7 +14,7 @@ import os
cur_dir = os.getcwd()
addin_id = "com.financials.getinfo"
addin_version = "3.0.1"
addin_version = "3.0.3"
addin_displayname = "Financial Market Extension"
addin_publisher_link = "https://github.com/cmallwitz/Financials-Extension"
addin_publisher_name = "The Publisher"
+3
View File
@@ -123,6 +123,9 @@ class Test(unittest.TestCase):
s = financials.getRealtime('VFIAX', Datacode.LAST_PRICE_TIME.value, 'YAHOO')
self.assertEqual(str, type(s), 'test_realtime_US_mutuals LAST_PRICE_TIME {}'.format(s))
s = financials.getRealtime('VFIAX', Datacode.DIV_YIELD.value, 'YAHOO')
self.assertTrue(testutils.is_positive_float(s), 'test_realtime_US_mutuals DIV_YIELD {}'.format(s))
def test_realtime_US_options(self):
# symbol from https://finance.yahoo.com/quote/IBM/options?p=IBM