From 6da75651e3315ece1dfdad93860ce8c5d102354e Mon Sep 17 00:00:00 2001 From: Jamie Date: Tue, 6 Apr 2021 15:17:26 -0400 Subject: [PATCH 01/17] Add docstring to crypto + add test --- gamestonk_terminal/cryptocurrency/coin_api.py | 26 +++++++++++++++++-- tests/test_coingecko_crypto.py | 14 ++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 tests/test_coingecko_crypto.py diff --git a/gamestonk_terminal/cryptocurrency/coin_api.py b/gamestonk_terminal/cryptocurrency/coin_api.py index 3049c28163c..68ef9e454b0 100644 --- a/gamestonk_terminal/cryptocurrency/coin_api.py +++ b/gamestonk_terminal/cryptocurrency/coin_api.py @@ -1,4 +1,8 @@ +""" pycoingecko_api """ +__docformat__ = "numpy" + import argparse +from typing import List import pandas as pd from pandas.plotting import register_matplotlib_converters import matplotlib.pyplot as plt @@ -11,8 +15,15 @@ register_matplotlib_converters() # pylint: disable=inconsistent-return-statements -def load(l_args): +def load(l_args: List[str]): + """Load selected Cryptocurrency + Parameters + ---------- + other_args : List[str] + argparse arguments + + """ cg = CoinGeckoAPI() parser = argparse.ArgumentParser( add_help=False, @@ -81,8 +92,19 @@ def load(l_args): return [None, pd.DataFrame()] -def view(coin, prices, l_args): +def view(coin, prices, l_args: List[str]): + """Plots loaded cryptocurrency + Parameters + ---------- + coin : str + Cryptocurrency + prices : pandas.DataFrame + Dataframe containing prices and dates for selected coin + other_args : List[str] + argparse arguments + + """ parser = argparse.ArgumentParser( add_help=False, prog="Crypto", diff --git a/tests/test_coingecko_crypto.py b/tests/test_coingecko_crypto.py new file mode 100644 index 00000000000..87d301459e0 --- /dev/null +++ b/tests/test_coingecko_crypto.py @@ -0,0 +1,14 @@ +from unittest import mock, TestCase +from gamestonk_terminal.cryptocurrency.coin_api import load + +# pylint: disable=unused-import + + +class TestCoinGeckoAPI(TestCase): + @mock.patch( + "gamestonk_terminal.cryptocurrency.coin_api.CoinGeckoAPI.get_coin_market_chart_by_id" + ) + def test_coin_api_load(self, mock_load): + coin, _ = load(["-c", "bitcoin"]) + self.assertEqual(coin, "bitcoin") + self.assertTrue(mock_load.called) From 7332c7613637dc36e711843b136c7ab7a6ede9db Mon Sep 17 00:00:00 2001 From: Jamie Date: Wed, 7 Apr 2021 10:47:42 -0400 Subject: [PATCH 02/17] rename vars --- gamestonk_terminal/cryptocurrency/coin_api.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gamestonk_terminal/cryptocurrency/coin_api.py b/gamestonk_terminal/cryptocurrency/coin_api.py index 68ef9e454b0..3dd11a7663f 100644 --- a/gamestonk_terminal/cryptocurrency/coin_api.py +++ b/gamestonk_terminal/cryptocurrency/coin_api.py @@ -15,7 +15,7 @@ register_matplotlib_converters() # pylint: disable=inconsistent-return-statements -def load(l_args: List[str]): +def load(other_args: List[str]): """Load selected Cryptocurrency Parameters @@ -51,11 +51,11 @@ def load(l_args: List[str]): ) try: - if l_args: - if "-" not in l_args[0]: - l_args.insert(0, "-c") + if other_args: + if "-" not in other_args[0]: + other_args.insert(0, "-c") - ns_parser = parse_known_args_and_warn(parser, l_args) + ns_parser = parse_known_args_and_warn(parser, other_args) if not ns_parser: return @@ -68,7 +68,7 @@ def load(l_args: List[str]): except KeyError: print(f"Could not find coin with the id: {ns_parser.coin}") print("") - return [None, pd.DataFrame] + return [None, pd.DataFrame()] prices = cg.get_coin_market_chart_by_id( coin, vs_currency=ns_parser.vs, days=ns_parser.days @@ -92,7 +92,7 @@ def load(l_args: List[str]): return [None, pd.DataFrame()] -def view(coin, prices, l_args: List[str]): +def view(coin: str, prices: pd.DataFrame, other_args: List[str]): """Plots loaded cryptocurrency Parameters @@ -113,7 +113,7 @@ def view(coin, prices, l_args: List[str]): """, ) try: - ns_parser = parse_known_args_and_warn(parser, l_args) + ns_parser = parse_known_args_and_warn(parser, other_args) if not ns_parser: return From bc610b84d4f1993576120f14aa0198cc97500edb Mon Sep 17 00:00:00 2001 From: Jamie Date: Thu, 8 Apr 2021 08:40:21 -0400 Subject: [PATCH 03/17] added return value mock + added test for `get_coins` --- .../cryptocurrency/crypto_helper.py | 6 ++++- tests/data/btc_usd_test_data.json | 1 + tests/test_coingecko_crypto.py | 23 ++++++++++++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/data/btc_usd_test_data.json diff --git a/gamestonk_terminal/cryptocurrency/crypto_helper.py b/gamestonk_terminal/cryptocurrency/crypto_helper.py index 171b6b9b525..f895f264bd5 100644 --- a/gamestonk_terminal/cryptocurrency/crypto_helper.py +++ b/gamestonk_terminal/cryptocurrency/crypto_helper.py @@ -1,5 +1,9 @@ -from pycoingecko import CoinGeckoAPI +""" +Helper script that generates a dictionary to convert between symbols and IDs. +This allows the user to input (for example) "btc" instead of the expected "bitcoin" +""" +from pycoingecko import CoinGeckoAPI cg = CoinGeckoAPI() coins = cg.get_coins() diff --git a/tests/data/btc_usd_test_data.json b/tests/data/btc_usd_test_data.json new file mode 100644 index 00000000000..40640d47814 --- /dev/null +++ b/tests/data/btc_usd_test_data.json @@ -0,0 +1 @@ +{"prices": [[1615291675936, 54197.2112595257], [1615295061892, 53716.43087684769], [1615298528995, 54805.53220855797], [1615302492602, 54535.207990578696], [1615305685091, 53995.81727486183], [1615309711072, 54116.53768890416], [1615312925116, 53905.91740993107], [1615316475182, 53986.35442023269], [1615320219093, 54275.98467171733], [1615324025713, 54349.50416467041], [1615327756784, 54421.2839556027], [1615331003933, 55072.12612558277], [1615334452511, 54872.34559095509], [1615338399355, 55541.66887970537], [1615342051291, 54398.22242410028], [1615345459482, 53915.365310762936], [1615349140414, 53492.98628108527], [1615352842336, 53717.42190392001], [1615356519624, 53702.68740414477], [1615360161085, 54000.41663595448], [1615363337023, 54452.96420993681], [1615367115993, 54817.13972425844], [1615370533581, 55161.20886449777], [1615374098871, 54952.51937503168], [1615377856958, 54891.75064537384], [1615381333167, 55308.692951688936], [1615385046078, 56206.08397674082], [1615388718632, 56144.089684129], [1615392077626, 56233.32806315913], [1615395662633, 57003.918706039185], [1615399439174, 56786.93564135379], [1615403261937, 56727.4160975527], [1615406514066, 56767.819329610335], [1615410273911, 56321.54959980982], [1615413961932, 57051.12928496267], [1615417405906, 57009.77749888765], [1615421095649, 56020.4877195857], [1615424680646, 55760.89448689877], [1615428373051, 55859.801739480245], [1615432476527, 56376.580609020144], [1615435404168, 55954.50683967058], [1615439228947, 55812.34671049414], [1615442990164, 55242.40633907952], [1615446210487, 55585.92771594528], [1615450496231, 54681.952272811905], [1615453886114, 54797.77878525888], [1615457046426, 54681.88185802314], [1615460942386, 55822.12261138012], [1615464381535, 56461.863673248154], [1615469553482, 56889.67906403037], [1615472196052, 57282.35018438994], [1615475230158, 56854.864423099076], [1615478507405, 56340.702778422674], [1615482262048, 56780.38965381692], [1615485936365, 56920.60636533779], [1615489469411, 57626.959777063465], [1615493229355, 57073.36303667102], [1615496689791, 57648.646501143616], [1615500590281, 57679.12359592459], [1615504294730, 58068.6305051581], [1615507564331, 57924.42321789544], [1615510949504, 57401.84771174121], [1615514568188, 56899.910347993], [1615518165727, 57091.58585411967], [1615521759447, 57096.37203733913], [1615525402650, 56828.199398776735], [1615529119586, 57336.74903732048], [1615532500517, 57131.19471455778], [1615536188030, 56786.764282243224], [1615540003028, 56732.771793241154], [1615543401269, 56591.37340545298], [1615547099001, 56843.41300036078], [1615550693613, 56526.41153241086], [1615554477464, 56254.90180235642], [1615557982935, 55877.0154726513], [1615561467823, 56205.14009262861], [1615564990462, 57142.386913347844], [1615568707665, 57600.263952365014], [1615572337980, 57162.248512292645], [1615576045348, 57539.28500443002], [1615579530792, 57176.60424627805], [1615583186932, 56877.41403767813], [1615586542180, 57005.4848739847], [1615590289170, 57296.39902380923], [1615594065134, 57228.19735530599], [1615598933479, 56355.82373301324], [1615601083816, 56604.34335037332], [1615604706033, 56655.92626598719], [1615608073337, 56759.529295815875], [1615611727644, 56866.07210427867], [1615615245875, 56766.601010834594], [1615619017089, 57086.55513924551], [1615622846031, 57800.12041708715], [1615626207959, 57507.985388135465], [1615630029797, 57585.70981621364], [1615633354780, 59223.275605059], [1615636872736, 59900.35578410297], [1615640638180, 59859.757524255445], [1615644257829, 60019.154014865024], [1615647958119, 59926.72408340353], [1615651298495, 59674.24397445059], [1615655299897, 59950.68155738199], [1615658775048, 60382.29718572576], [1615662215300, 60200.25813827755], [1615665663669, 60724.89915655216], [1615669370611, 61599.218625302914], [1615672941010, 60970.40074190444], [1615676684768, 61109.63405108519], [1615680260839, 61199.55658901807], [1615683628338, 61326.079083219214], [1615687299096, 61223.72402261049], [1615690915238, 61042.42369486592], [1615694625648, 61339.67374704608], [1615698300422, 61255.7324237413], [1615701673193, 61063.99589586749], [1615705265674, 61037.8521432208], [1615708931347, 60647.10897637241], [1615712510410, 60740.918301944606], [1615716189205, 61039.70494831173], [1615719804272, 60376.25378544397], [1615723407005, 60258.93284698266], [1615726882117, 60459.05192262697], [1615730647326, 59969.58879888484], [1615734370515, 60060.95234158716], [1615737955740, 59618.13407057754], [1615741290536, 59627.55833353179], [1615744838636, 59895.3548754664], [1615748648066, 60237.92851996509], [1615752244071, 59943.76454666465], [1615755616959, 60318.88660479486], [1615759274177, 60081.24363525743], [1615762860625, 60268.170294709016], [1615766854967, 59195.39988565917], [1615770321846, 59687.036158902265], [1615773806734, 60142.79928837695], [1615777491734, 60209.23663824686], [1615780890985, 60520.558882163925], [1615784729970, 59753.77686143004], [1615788373369, 59116.172963045894], [1615791800980, 58697.51987420351], [1615795307712, 58055.508817991344], [1615798939055, 57820.59792846678], [1615802618633, 55527.63692550928], [1615806067855, 56553.590802835075], [1615809822991, 56397.15062504499], [1615813685223, 57083.81634335159], [1615816915926, 57157.64717060753], [1615820603360, 56711.812936868315], [1615824063714, 56304.65154515878], [1615827670769, 56410.942916697844], [1615831332017, 55939.55161067859], [1615835309404, 56255.40132398365], [1615838723378, 56860.21594649329], [1615842060604, 56486.761398087074], [1615845693652, 57004.74625996393], [1615849500955, 56225.514894505184], [1615853044073, 55856.64915126205], [1615856537727, 54314.17985218141], [1615860036744, 54740.84369741205], [1615863985754, 54700.96297339235], [1615867315087, 54461.8016382057], [1615870980592, 54618.35852651182], [1615874489240, 54100.0562778398], [1615878343549, 55493.410561825534], [1615882087435, 55447.27738063856], [1615885483752, 56098.88854341092], [1615888972630, 55990.39311913381], [1615892837634, 56035.95348876245], [1615896108767, 55505.133810481835], [1615899778721, 55063.929779567785], [1615903304861, 55344.306190085685], [1615907009565, 55701.12109199864], [1615910760509, 55944.49906426915], [1615914096819, 55793.71463035712], [1615918221233, 55515.00437537398], [1615921474642, 55529.357364636984], [1615925211062, 55953.57246344578], [1615928719695, 56531.53178588806], [1615932105297, 56607.05456067917], [1615935815840, 56561.46001030555], [1615939416579, 56830.253335076224], [1615943078701, 56591.53406938549], [1615946594276, 56350.27244719438], [1615950220730, 56021.43856397972], [1615953805501, 55767.55745545818], [1615957272652, 55808.06977991423], [1615960894642, 56072.65354449394], [1615964517436, 56390.313112672535], [1615968470393, 55982.956997777146], [1615971661135, 55924.52921923927], [1615975321627, 54736.85287248801], [1615978919276, 55257.5269325229], [1615982850778, 55064.95831701066], [1615986248755, 55515.787651514256], [1615990271893, 55040.49867767686], [1615993315980, 54928.69533691516], [1615997326220, 55047.929323051816], [1616000437382, 55464.53405988903], [1616004102938, 55685.99452727078], [1616008030978, 57990.22953862034], [1616011240836, 58006.36628788306], [1616015059385, 58126.99104200835], [1616019002357, 58690.53518386924], [1616022200886, 58639.388822757624], [1616026004512, 59269.23466458064], [1616029519412, 59183.520574904316], [1616033225896, 59275.92110580546], [1616036888067, 59246.3373186804], [1616040190344, 58864.00639180011], [1616043933137, 59009.87355252549], [1616047298161, 59262.27406190287], [1616051218150, 59182.04993845718], [1616054460512, 58422.90438010635], [1616058058686, 58240.6017430783], [1616061849086, 58622.95921766864], [1616065381728, 58733.42309492124], [1616069247157, 58318.77651357175], [1616072959580, 58289.42679949738], [1616076434490, 58039.462674813054], [1616079925050, 58054.00515486485], [1616085485393, 60119.69282225918], [1616089010968, 59599.99122325626], [1616092047998, 58905.89493144474], [1616095713523, 58183.18949024328], [1616099493338, 57838.58222570468], [1616102991808, 58034.48677045874], [1616106426733, 58087.88090975076], [1616110197741, 57878.92647065825], [1616113851842, 56570.868063677444], [1616116797687, 57240.896528233665], [1616120616139, 57605.45215001726], [1616124339430, 57715.48641356501], [1616128447326, 58039.57003161787], [1616131796029, 58162.15091197048], [1616135129947, 58260.14473402519], [1616138771830, 58378.50468547482], [1616142682924, 58340.06944099374], [1616145774807, 58920.0605906511], [1616149243246, 58256.640351853086], [1616153134889, 58782.640257855106], [1616157036034, 59337.51481886304], [1616159327042, 58814.47948327677], [1616163739842, 58502.606498305904], [1616167906864, 58992.830709114336], [1616171012204, 59058.947702980244], [1616175237724, 58928.42001573131], [1616178074629, 58458.55194270253], [1616180955307, 58954.922139441354], [1616185851441, 59252.9178869348], [1616189275261, 58797.17429271959], [1616193197295, 58733.07305844571], [1616195834783, 58520.49975505858], [1616200007470, 58613.361490397234], [1616203132891, 58880.80515899088], [1616207252712, 58935.472438339624], [1616209712003, 58706.552792938855], [1616214261186, 58844.277500227996], [1616217015786, 58466.4126744696], [1616220073932, 58498.19469756111], [1616223994014, 58659.34053252024], [1616228163087, 58905.6888838517], [1616231008311, 58959.98157110788], [1616235862921, 59068.04599110158], [1616238241353, 59015.58193781006], [1616242738615, 59359.52093337949], [1616247290948, 60104.347056141916], [1616249855404, 59034.0770895636], [1616254189107, 59775.93543647927], [1616257413046, 59003.2609076838], [1616260711195, 59301.97156145218], [1616263477335, 59349.55462601853], [1616268127212, 59474.15153863859], [1616271721045, 59094.252922028834], [1616275325249, 58880.22111954313], [1616279650679, 58860.33869924664], [1616282993885, 58705.984897852395], [1616285979902, 58593.554356274595], [1616288605657, 58521.42950419339], [1616292243572, 58384.71654836946], [1616296011828, 57685.00896205314], [1616299344468, 58059.3410411496], [1616303279836, 57204.83146670865], [1616306986124, 57245.55049103557], [1616310524524, 57358.58704343748], [1616314074468, 57195.51022394066], [1616317251670, 57405.65772937322], [1616321597563, 56127.53856499292], [1616324937717, 56397.68639478561], [1616328462216, 56421.45811912884], [1616331656647, 56436.02130763307], [1616335676788, 57348.43767724004], [1616339264204, 57294.30425728956], [1616343092715, 57206.584405867274], [1616346290056, 57544.7289729778], [1616350483787, 57519.942121831016], [1616353767776, 57721.71000617912], [1616357042749, 57753.52871455206], [1616360458951, 57925.0524403266], [1616364160603, 58285.001135857936], [1616367728232, 57811.50204628491], [1616371567678, 57354.739920163214], [1616375641815, 56559.614756020645], [1616379147652, 56738.006827289326], [1616382299973, 57148.606608667185], [1616386311282, 57759.958801922476], [1616389457772, 57729.13303291715], [1616393194685, 57884.199529105186], [1616397271283, 57804.8554487396], [1616400290989, 57653.03001224684], [1616404208628, 57154.460111858876], [1616407470800, 57274.73001313157], [1616411227987, 58191.14606750297], [1616414760916, 57778.037033913984], [1616418868346, 57212.645624690434], [1616422484218, 57168.6052605685], [1616425317074, 57176.08072359338], [1616429285641, 57213.05319834618], [1616432715113, 56689.987577235144], [1616436216234, 57206.278152004816], [1616440245129, 56512.049521770954], [1616443320990, 56012.01246295983], [1616447443176, 54685.620977466664], [1616451161572, 54108.99610301334], [1616454129952, 54580.29868196107], [1616457650275, 54370.137557895185], [1616461499721, 54627.98202669998], [1616465192486, 55273.072708009466], [1616468964967, 54670.872551213455], [1616472478625, 54705.47231037073], [1616476448041, 54300.00885744936], [1616481368907, 53728.74739472279], [1616484813671, 53879.604390034074], [1616487997994, 54076.2408760373], [1616491404414, 54383.66690779431], [1616494870547, 54635.413646216344], [1616498448432, 54663.26362555866], [1616501569155, 54595.67879554625], [1616506332522, 55290.92890675391], [1616508305393, 55220.96906015737], [1616513569375, 55060.87484589929], [1616516688478, 55025.90136305591], [1616519549518, 55701.85463369069], [1616523356725, 55659.94826882035], [1616526916776, 55532.50663030126], [1616530641073, 55002.604365262465], [1616534820666, 54401.024502487126], [1616537049137, 54766.678646683315], [1616541204682, 54528.10754392893], [1616544826563, 54535.55208982534], [1616549651113, 54261.96038629167], [1616552677047, 54611.537968737844], [1616556076322, 54379.3642873554], [1616559993187, 54624.24408405492], [1616563240600, 53872.645066439254], [1616567128908, 53990.88816505108], [1616570607949, 55532.8220601321], [1616574953817, 56230.40564019139], [1616578367528, 56460.32612849615], [1616581465476, 56262.41673809173], [1616585051563, 56533.9695248606], [1616589094303, 56825.38628893386], [1616591928462, 56830.9327369185], [1616594564686, 56698.918130913626], [1616599911730, 56508.79771049722], [1616602949063, 56166.6951885964], [1616607306267, 55855.69326032849], [1616609817036, 56194.668655865156], [1616613541795, 55430.54699917186], [1616617356094, 54260.98750125652], [1616620449563, 54197.617328405606], [1616623771940, 53675.10120900251], [1616627566824, 52665.10448340395], [1616631592560, 52656.93298940185], [1616635050274, 52570.494143167474], [1616638599448, 52103.99678335657], [1616641585603, 52396.97155368745], [1616646484651, 52505.79076294559], [1616649462508, 52554.60079226282], [1616653469585, 53277.374654964246], [1616657839908, 52842.47705084695], [1616660646420, 52462.210248386655], [1616663836016, 52524.95002678938], [1616668167385, 52825.56322827484], [1616670627143, 53029.915556501204], [1616674580444, 51849.29883113804], [1616678177475, 50965.81854672072], [1616682712318, 51769.242400916155], [1616685800136, 50846.2978463142], [1616688154809, 51086.83867713813], [1616692333928, 51580.394625503905], [1616697153290, 51720.922991246174], [1616704096702, 52641.18511385942], [1616705746524, 52214.08906649431], [1616708501557, 52425.61232462026], [1616710977264, 52650.25018371413], [1616715170367, 51741.475939379234], [1616718730278, 51763.69444701034], [1616721402519, 52336.280076489566], [1616724339846, 52370.356446370715], [1616729705708, 52604.86940586396], [1616732366746, 52346.980145103036], [1616734928802, 52780.56650818955], [1616740351085, 52664.67434227691], [1616743920255, 52686.61814096189], [1616747371998, 53748.30159153818], [1616749858691, 53544.236394429645], [1616753633203, 53270.528795476275], [1616756522614, 53358.68447010915], [1616760799797, 52803.97412720671], [1616763774928, 52961.044361849184], [1616768145895, 53231.86159351403], [1616771660225, 53398.670308864224], [1616776417918, 53685.67192080944], [1616778973007, 53613.96801410128], [1616781855019, 53920.53866748657], [1616786457339, 53661.23838841103], [1616790404418, 54275.84618352572], [1616793148935, 54184.07485791139], [1616796447024, 54632.534114012815], [1616799738147, 54430.970894304104], [1616804601964, 55662.59455207245], [1616808701870, 54767.57942014555], [1616812335025, 54868.69349607076], [1616816023318, 54662.55881740068], [1616819756494, 55228.893228501875], [1616822396379, 54840.440575363675], [1616825651956, 55170.13460186389], [1616828654736, 55104.44860459153], [1616833728998, 54917.90563223704], [1616837022766, 54870.09148841475], [1616841070909, 54896.564064304395], [1616843142046, 54590.846921927594], [1616847323912, 54431.87696132494], [1616851790517, 54356.88804430096], [1616853646083, 54732.77755740252], [1616858297916, 54762.4164203757], [1616861551509, 55247.26171293311], [1616865349655, 56027.80757436747], [1616869975383, 55840.51498362393], [1616872108900, 55766.444912887215], [1616875355222, 55760.11954087084], [1616879351680, 55864.525076619], [1616883782288, 56313.7733320288], [1616887831953, 56050.468693711664], [1616889955891, 55754.075819698795], [1616893679594, 56048.001214875396], [1616896947344, 56081.24585239963], [1616900553334, 55867.53102513625], [1616904149299, 56097.82330002727], [1616908189740, 56268.755885901715], [1616911471063, 56215.093204298275], [1616914917120, 55886.85105909057], [1616919303266, 56185.7272732345], [1616922321672, 56369.44831036201], [1616925870022, 56195.28601727139], [1616929896171, 55997.949773407076], [1616932860609, 55832.238432898295], [1616937175671, 55653.28819538567], [1616940625680, 55604.72921296217], [1616944108339, 55824.56133033417], [1616947691245, 56375.59365819968], [1616951068774, 56291.17659100954], [1616954928589, 55923.453152756425], [1616958617015, 55266.19005378875], [1616962526306, 55101.65555788805], [1616966246988, 54936.9795737789], [1616969932159, 55147.699821054484], [1616972824646, 55708.92724807546], [1616976090633, 55856.53765470235], [1616980673292, 55136.437332020636], [1616984209069, 55247.495614291875], [1616987612376, 55398.759376738904], [1616990873356, 55407.01411957773], [1616994720043, 55233.35736928756], [1616997853633, 55164.75983216374], [1617002332847, 55715.51143313405], [1617005161174, 55989.14928701649], [1617008584190, 57301.76721685812], [1617012514706, 58037.245130591735], [1617016039392, 57991.42014152597], [1617020008464, 58179.65000175754], [1617023435434, 58081.957919551634], [1617027039238, 57956.87897488283], [1617030448415, 58074.20987195947], [1617034003237, 57791.993225382816], [1617038408185, 57830.87651694959], [1617040952521, 57899.87522063223], [1617045073768, 57731.49209394746], [1617049013636, 57536.058725753304], [1617052693432, 57425.71573238437], [1617055605633, 57566.52153875996], [1617058954552, 57695.0105528855], [1617063151785, 57541.493889485166], [1617066190645, 57568.89737881677], [1617069989206, 57367.62505892605], [1617073345450, 57257.45173879713], [1617076917393, 57168.37695431903], [1617081398730, 57544.11922987738], [1617084924632, 57566.66280143937], [1617088397937, 58233.16116357654], [1617091296417, 58096.30539415877], [1617095909177, 58086.94156982753], [1617099450146, 59370.77224252133], [1617102228966, 58835.08988681757], [1617106091711, 59312.66687308395], [1617110262532, 59002.11132994846], [1617113144250, 58887.98011702786], [1617117617213, 58836.24052441693], [1617120554726, 58599.74574158607], [1617124206604, 58710.2606992232], [1617128449903, 59168.37882426951], [1617131509300, 58812.99862786195], [1617134860533, 59020.51247967842], [1617138731266, 58628.66892578922], [1617142004697, 58786.16573618672], [1617146569750, 58670.185194064696], [1617149030895, 58668.628336761], [1617153212294, 58991.780312289804], [1617156766729, 58890.19555309385], [1617160737753, 58574.206311949114], [1617164018834, 58566.24735463029], [1617167050380, 58753.29914838391], [1617171210507, 58731.10822522863], [1617175070790, 59749.04456614096], [1617179778318, 57827.356226587064], [1617182266092, 57886.224184633844], [1617184960799, 57957.879948754045], [1617189540784, 57975.09087225986], [1617192383625, 57851.92481688038], [1617196721671, 58152.72049820726], [1617199979871, 58582.34719126965], [1617203592186, 59025.80366755706], [1617206697727, 59444.240746304145], [1617210620877, 59034.80471833153], [1617214077919, 59367.900866133], [1617218053085, 59415.638666609266], [1617222020274, 58658.46144169865], [1617224539506, 58974.790216654095], [1617229195967, 58763.403782667134], [1617231884037, 58659.81607908696], [1617235645796, 58772.18128166619], [1617238883818, 59143.22257552314], [1617243551992, 59205.02016179689], [1617246654378, 59059.296123480664], [1617250098917, 59053.454752719226], [1617253995987, 58856.7555682645], [1617257426896, 58831.90301228289], [1617260961273, 58727.07403791155], [1617264124564, 58821.11795397773], [1617267920011, 58807.75368432521], [1617271270041, 58782.882958226386], [1617275905591, 58452.395374772816], [1617279222759, 58659.56112535479], [1617283029260, 59080.37202162234], [1617286242115, 58912.839934889664], [1617290079854, 59046.69574320105], [1617293474324, 58856.159718234754], [1617297459658, 58756.073589787266], [1617301174097, 58419.910794038595], [1617304629938, 58729.47445825195], [1617307248425, 58903.55742192981], [1617311692196, 58850.07962471818], [1617315051384, 58819.32041107996], [1617319092425, 58941.76510849229], [1617322747251, 58749.22565086035], [1617325572590, 58856.23130267705], [1617329206376, 58945.19853094345], [1617333206284, 60086.89754589551], [1617336414247, 59981.5717996092], [1617339741861, 59632.02613531098], [1617343317637, 59556.26163112567], [1617347874924, 59682.03940351826], [1617351532469, 59514.33141048923], [1617354938442, 59466.53730812896], [1617359441974, 59571.34002812948], [1617361387036, 59606.70196934612], [1617365336451, 59555.319297196715], [1617369265342, 59391.61172421189], [1617372358222, 59154.70585959291], [1617376597093, 59567.96331216299], [1617379866125, 59443.62385220146], [1617382926554, 59247.032989256695], [1617386967819, 59157.820800411704], [1617390158842, 59090.492263376924], [1617393747051, 58893.75527918275], [1617397281964, 58694.958404414356], [1617401451583, 58749.88037721576], [1617404481989, 58893.001117410044], [1617409726836, 59528.37892164109], [1617411835470, 59265.0753028216], [1617415980643, 59219.85628738777], [1617419080079, 59336.535414007325], [1617424012999, 59276.41398768474], [1617426842032, 59361.20631315944], [1617429724170, 59448.731353331474], [1617433667443, 59399.187491661454], [1617437272135, 59333.939143893134], [1617441063755, 59039.9444031868], [1617444224902, 59280.317295353365], [1617448421265, 59393.445682128186], [1617451974389, 59256.47497602085], [1617454956111, 59266.94148957775], [1617458505822, 59372.529763359315], [1617462432313, 59149.745014933], [1617466406142, 58853.69674295725], [1617469535587, 58790.69751118718], [1617473312481, 58328.21614403807], [1617476600222, 58457.01533531664], [1617480124803, 58413.903641970195], [1617483751714, 58139.05178787671], [1617487620749, 57672.79807432743], [1617490948104, 57841.846706724886], [1617494967288, 57008.11352582882], [1617499464555, 57029.78216415929], [1617503519510, 57562.65119661691], [1617507438359, 57363.16826376454], [1617510725477, 57587.84983322471], [1617512530592, 57559.69655552429], [1617516184924, 57519.43493794092], [1617519699291, 57411.251382936745], [1617523430230, 57546.25967982146], [1617526887410, 57523.218100742495], [1617530492127, 57708.76713622234], [1617534345051, 57735.41781878782], [1617537718041, 57488.87793485672], [1617541471040, 57852.49875848458], [1617545018116, 58158.410064759875], [1617548777105, 58183.71202960251], [1617552453629, 57904.7496569996], [1617555792369, 58071.069822147176], [1617559278598, 58116.47102916853], [1617563010833, 58089.17083448701], [1617566635263, 57911.64657931808], [1617570330282, 58052.909515837775], [1617573737649, 58143.911595519094], [1617577464292, 58120.98745488823], [1617581102876, 58228.802623466196], [1617584508137, 57964.45168874164], [1617588093176, 57727.028609426656], [1617591770029, 57628.8733858091], [1617595320295, 57538.9566176747], [1617599157738, 57309.23807827551], [1617602513434, 57076.96249690862], [1617606276448, 57230.67950213643], [1617609903254, 57227.76137198758], [1617613337542, 57166.78415244304], [1617617309725, 57517.526225448266], [1617620851328, 57653.28064629034], [1617624394822, 57738.002885906935], [1617627723529, 58034.33948855353], [1617631245919, 58072.860627498114], [1617634997096, 58957.30091831679], [1617638464443, 59025.62077552239], [1617642210396, 58986.78387680816], [1617645866889, 58871.29431779917], [1617649314803, 58849.08060757151], [1617652959467, 58999.47774005186], [1617656603399, 58799.63693458118], [1617660264773, 58682.635499593016], [1617663905558, 58890.42933312271], [1617667493830, 58833.186957538484], [1617672717177, 59037.33545469934], [1617674588102, 58846.465902246], [1617678076379, 58768.96552958154], [1617681629319, 58770.32137536113], [1617685509685, 58793.97065343278], [1617689059020, 58884.688302930306], [1617692544445, 58863.56101521906], [1617696404404, 58491.50994194401], [1617699903949, 58520.661848174524], [1617703438437, 58717.172972835484], [1617707034510, 58529.054562881916], [1617710532087, 58476.36966941032], [1617714271898, 58665.67256129377], [1617717944437, 58341.87623355505], [1617721479980, 57846.95949107808], [1617724967811, 57964.12468744507], [1617728770233, 58139.86314253245], [1617732384643, 58243.06360414102], [1617735975341, 58278.42782480332], [1617739290391, 58191.19680426938], [1617742907406, 58218.226716393656], [1617746815588, 57873.38515509634], [1617750169915, 57990.630038086194], [1617754141720, 58013.39701271109], [1617757381948, 57614.1137496138], [1617761027788, 57520.55571865165], [1617764697270, 57858.948039492294], [1617768137159, 57882.040067521564], [1617771843193, 57597.84422549286], [1617775455622, 58296.35781501513], [1617779041148, 58263.23110335668], [1617782517775, 57880.68389549052], [1617786171269, 57816.94630796729], [1617789983349, 57529.428400040044], [1617793533771, 57030.68433073952], [1617796957648, 56169.80794234466], [1617800860567, 56511.354462784744], [1617804412316, 56779.09325693027], [1617807682087, 56688.65221952173], [1617811620156, 56373.15150453946], [1617815119127, 56645.457766730455], [1617818663110, 56116.78532029333], [1617822165641, 56071.85834130296], [1617825701377, 56039.83051439416], [1617829625369, 56297.66166666491], [1617832887344, 56295.35695849729], [1617836511453, 56495.771344222034], [1617840305905, 56134.41738866435], [1617843897129, 56609.28843050808], [1617847668329, 56604.5351222436], [1617849911898, 56287.662136354644], [1617852062936, 56411.61826826836], [1617854819655, 56606.21607451404], [1617858135400, 56966.05438606517], [1617862321266, 56941.845414894626], [1617865595799, 57217.85025879367], [1617868939834, 57133.52569229849], [1617872695579, 56904.25763576343], [1617876318306, 56726.119961074626], [1617880044757, 56729.08324934234], [1617882311000, 56539.679911617284]], "market_caps": [[1615291675936, 1012051675826.3314], [1615295061892, 1002949510393.7107], [1615298528995, 1019145121682.0768], [1615302492602, 1018423271679.9492], [1615305685091, 1011750361054.4108], [1615309711072, 1008762821124.3375], [1615312925116, 1005307948988.532], [1615316475182, 1005983832200.4451], [1615320219093, 1012211834737.4916], [1615324025713, 1014517482025.5963], [1615327756784, 1013771234850.5692], [1615331003933, 1016357433972.4882], [1615334452511, 1022496487846.3273], [1615338399355, 1036521729009.2935], [1615342051291, 1018603364931.7382], [1615345459482, 1005369750646.2534], [1615349140414, 996373747263.5864], [1615352842336, 1001262095322.6766], [1615356519624, 1001784321657.9282], [1615360161085, 1005225740873.7455], [1615363337023, 1015537218640.2648], [1615367115993, 1022276323862.4382], [1615370533581, 1028752739199.4718], [1615374098871, 1024861024335.6202], [1615377856958, 1023729393000.2014], [1615381333167, 1032795361508.6113], [1615385046078, 1044556873889.1721], [1615388718632, 1045895788182.3032], [1615392077626, 1047534645285.4288], [1615395662633, 1056862928348.112], [1615399439174, 1056634897283.805], [1615403261937, 1058466986695.5905], [1615406514066, 1058736463468.2963], [1615410273911, 1050389550484.6573], [1615413961932, 1058664395566.2867], [1615417405906, 1063369392830.163], [1615421095649, 1044805904677.5541], [1615424680646, 1039967503170.9103], [1615428373051, 1042092028889.3531], [1615432476527, 1049974259207.3452], [1615435404168, 1043443793334.6167], [1615439228947, 1040995562754.2975], [1615442990164, 1033475057539.4392], [1615446210487, 1038537960934.6461], [1615450496231, 1019855976389.1533], [1615453886114, 1023602625105.7936], [1615457046426, 1022614261561.4558], [1615460942386, 1038730210146.6626], [1615464381535, 1049017059966.2655], [1615469553482, 1062496115038.7285], [1615472196052, 1066339641278.4434], [1615475230158, 1056442672442.188], [1615478507405, 1050808306573.6556], [1615482262048, 1058978084222.3896], [1615485936365, 1060589549691.0514], [1615489469411, 1074728666673.4261], [1615493229355, 1066788646216.6405], [1615496689791, 1075214244973.5629], [1615500590281, 1074733815212.6633], [1615504294730, 1083052893121.113], [1615507564331, 1077836070933.286], [1615510949504, 1064037566948.0352], [1615514568188, 1061259744569.6667], [1615518165727, 1065567588927.6849], [1615521759447, 1064929043404.7603], [1615525402650, 1059929342583.9034], [1615529119586, 1068932709674.6416], [1615532500517, 1065715008263.864], [1615536188030, 1061906198446.0718], [1615540003028, 1062036206261.5189], [1615543401269, 1054215745495.7323], [1615547099001, 1054003938247.2416], [1615550693613, 1055121926997.6426], [1615554477464, 1051260097041.7411], [1615557982935, 1044242190053.3328], [1615561467823, 1046709595436.4211], [1615564990462, 1065814429323.394], [1615568707665, 1070195238794.9457], [1615572337980, 1067697146691.3359], [1615576045348, 1072987306724.5089], [1615579530792, 1064580965381.5765], [1615583186932, 1058480126725.1206], [1615586542180, 1063273429555.1719], [1615590289170, 1068703492797.1013], [1615594065134, 1069776383193.8628], [1615598933479, 1055059392017.8119], [1615601083816, 1052492685039.9963], [1615604706033, 1055834822745.9238], [1615608073337, 1058698606260.8113], [1615611727644, 1060689746907.1454], [1615615245875, 1058836187024.5416], [1615619017089, 1064806969734.7769], [1615622846031, 1069572252758.1261], [1615626207959, 1072673448250.7355], [1615630029797, 1073230643633.8506], [1615633354780, 1110839145139.0059], [1615636872736, 1117302228227.3777], [1615640638180, 1116547176648.315], [1615644257829, 1115057332309.9011], [1615647958119, 1118057012986.3286], [1615651298495, 1112844151528.9663], [1615655299897, 1117924366314.0764], [1615658775048, 1119840507404.5215], [1615662215300, 1122477685957.758], [1615665663669, 1132693528280.4788], [1615669370611, 1149451094184.3562], [1615672941010, 1137035275282.1143], [1615676684768, 1137655163951.0017], [1615680260839, 1145191373521.5942], [1615683628338, 1144397227174.032], [1615687299096, 1142016838345.4575], [1615690915238, 1138636537665.073], [1615694625648, 1144183839944.371], [1615698300422, 1142620757295.2522], [1615701673193, 1140737173912.1155], [1615705265674, 1134235186680.8318], [1615708931347, 1131277390405.551], [1615712510410, 1134084254438.1685], [1615716189205, 1139629063725.7043], [1615719804272, 1124320038530.3896], [1615723407005, 1122849451942.228], [1615726882117, 1125640442127.6655], [1615730647326, 1119082002582.649], [1615734370515, 1120416359860.0762], [1615737955740, 1115039249309.2683], [1615741290536, 1115334112621.9104], [1615744838636, 1117279324915.8481], [1615748648066, 1123672294818.577], [1615752244071, 1118914903855.6436], [1615755616959, 1125187364666.9978], [1615759274177, 1120128438103.9277], [1615762860625, 1124243533504.5674], [1615766854967, 1111684638819.0723], [1615770321846, 1114319557245.524], [1615773806734, 1121912378345.682], [1615777491734, 1124987073396.4485], [1615780890985, 1127202425459.2253], [1615784729970, 1114278162336.7925], [1615788373369, 1104851221251.5002], [1615791800980, 1094961497174.4738], [1615795307712, 1089158390287.9957], [1615798939055, 1083311622900.4917], [1615802618633, 1035464946612.2109], [1615806067855, 1047507614814.1409], [1615809822991, 1055741944180.3838], [1615813685223, 1055886457782.7373], [1615816915926, 1064792840078.3971], [1615820603360, 1064208673247.5623], [1615824063714, 1050942887134.5773], [1615827670769, 1055025630528.2648], [1615831332017, 1043541147386.887], [1615835309404, 1048175319132.4121], [1615838723378, 1059436040299.452], [1615842060604, 1053595787720.6975], [1615845693652, 1061759233511.0624], [1615849500955, 1050601961574.5925], [1615853044073, 1042081985302.4164], [1615856537727, 1013233740851.4368], [1615860036744, 1021195530073.6857], [1615863985754, 1019369735023.0603], [1615867315087, 1015994440376.014], [1615870980592, 1018918095152.8976], [1615874489240, 1004745833132.7516], [1615878343549, 1034332267955.3279], [1615882087435, 1034188019865.7485], [1615885483752, 1046543671102.7699], [1615888972630, 1047569254671.5896], [1615892837634, 1045907669127.9967], [1615896108767, 1032234178238.0072], [1615899778721, 1027246518600.9712], [1615903304861, 1033566733597.7367], [1615907009565, 1039136776322.5891], [1615910760509, 1043332578701.9874], [1615914096819, 1041693635355.6351], [1615918221233, 1034106442424.9229], [1615921474642, 1036443125791.3417], [1615925211062, 1043407587228.6842], [1615928719695, 1054545582464.1112], [1615932105297, 1056054473644.5378], [1615935815840, 1058276409303.3033], [1615939416579, 1060221966894.7418], [1615943078701, 1054941819736.7476], [1615946594276, 1051271358978.1277], [1615950220730, 1042556866051.2958], [1615953805501, 1040969070102.431], [1615957272652, 1043746540194.6315], [1615960894642, 1046098770043.6932], [1615964517436, 1051539750996.0149], [1615968470393, 1043728664707.8896], [1615971661135, 1045143448487.0474], [1615975321627, 1021188845087.4371], [1615978919276, 1031354606510.7222], [1615982850778, 1028102510637.0326], [1615986248755, 1034039887873.849], [1615990271893, 1031735713786.832], [1615993315980, 1024778193269.6737], [1615997326220, 1027411398259.8506], [1616000437382, 1034777851276.6357], [1616004102938, 1038909933347.6168], [1616008030978, 1082094260886.0562], [1616011240836, 1082204821643.0312], [1616015059385, 1085870650315.4075], [1616019002357, 1094972764194.5266], [1616022200886, 1094019655106.9286], [1616026004512, 1101028543248.462], [1616029519412, 1103591973288.2297], [1616033225896, 1105419683686.7173], [1616036888067, 1106472379790.1816], [1616040190344, 1099727363934.3005], [1616043933137, 1100518159668.4878], [1616047298161, 1104098985373.6118], [1616051218150, 1104972194697.1948], [1616054460512, 1087954669159.6445], [1616058058686, 1088201619703.0168], [1616061849086, 1094302174613.4951], [1616065381728, 1095801221366.5646], [1616069247157, 1088558826785.0583], [1616072959580, 1087201217842.748], [1616076434490, 1082861466186.1324], [1616079925050, 1083133486698.0817], [1616085485393, 1121675653869.6978], [1616089010968, 1113564823969.8616], [1616092047998, 1100631423325.9167], [1616095713523, 1081287115604.2749], [1616099493338, 1079125834935.1207], [1616102991808, 1082663215414.5057], [1616106426733, 1086439926081.4564], [1616110197741, 1080010401846.5079], [1616113851842, 1067531992141.746], [1616116797687, 1066015602271.4768], [1616120616139, 1074100933805.0355], [1616124339430, 1076920806140.509], [1616128447326, 1082895390941.0924], [1616131796029, 1083651406660.0416], [1616135129947, 1087117723497.1777], [1616138771830, 1088586070912.6133], [1616142682924, 1088512982754.7832], [1616145774807, 1101842341339.6245], [1616149243246, 1090450971409.125], [1616153134889, 1097814823069.7965], [1616157036034, 1107129320192.8362], [1616159327042, 1100735482484.5864], [1616163739842, 1090466075586.7065], [1616167906864, 1100705166313.0688], [1616171012204, 1101941394753.895], [1616175237724, 1098983602060.1056], [1616178074629, 1090744857782.831], [1616180955307, 1100992567475.9224], [1616185851441, 1105571279428.3877], [1616189275261, 1100259330806.701], [1616193197295, 1092660576603.5802], [1616195834783, 1092753714117.7067], [1616200007470, 1090580243972.8696], [1616203132891, 1100928560364.9817], [1616207252712, 1101314591340.7112], [1616209712003, 1095530613418.9001], [1616214261186, 1097965076128.1918], [1616217015786, 1091594908447.2728], [1616220073932, 1089545780072.58], [1616223994014, 1092555956976.0907], [1616228163087, 1099982700166.3623], [1616231008311, 1100135357414.9702], [1616235862921, 1102154332366.816], [1616238241353, 1101176169546.2432], [1616242738615, 1108386330268.561], [1616247290948, 1121847115176.056], [1616249855404, 1097790328913.704], [1616254189107, 1112181121828.7307], [1616257413046, 1100958779212.3525], [1616260711195, 1106844789646.4412], [1616263477335, 1107157999936.7974], [1616268127212, 1109843171498.7007], [1616271721045, 1102666966816.9858], [1616275325249, 1098675485980.115], [1616279650679, 1098002843207.7448], [1616282993885, 1094187746610.7574], [1616285979902, 1090675371957.3483], [1616288605657, 1094646281765.0807], [1616292243572, 1091393855935.7598], [1616296011828, 1077094254707.1777], [1616299344468, 1083372788992.5913], [1616303279836, 1065019855917.4774], [1616306986124, 1070804511212.53], [1616310524524, 1071153029396.849], [1616314074468, 1066705291366.597], [1616317251670, 1071184521532.2241], [1616321597563, 1047732128493.704], [1616324937717, 1052805233793.9839], [1616328462216, 1054681596773.9652], [1616331656647, 1053609867779.6582], [1616335676788, 1069632484503.7726], [1616339264204, 1071720014818.6555], [1616343092715, 1067269795926.9243], [1616346290056, 1073801503241.3549], [1616350483787, 1073340813974.5564], [1616353767776, 1072527027369.1948], [1616357042749, 1076532645113.9022], [1616360458951, 1080907544810.0925], [1616364160603, 1086604740143.5751], [1616367728232, 1081114730675.619], [1616371567678, 1074356788297.177], [1616375641815, 1054603089780.893], [1616379147652, 1058770526835.9502], [1616382299973, 1066433346233.9955], [1616386311282, 1077789769968.3773], [1616389457772, 1077268919244.0087], [1616393194685, 1080649481437.1119], [1616397271283, 1078821621448.3387], [1616400290989, 1075856332347.9668], [1616404208628, 1067696136077.2839], [1616407470800, 1068801216686.9276], [1616411227987, 1087289307550.4452], [1616414760916, 1079285842952.9055], [1616418868346, 1067651931094.5319], [1616422484218, 1066832261069.8894], [1616425317074, 1066973191253.587], [1616429285641, 1068134786787.3273], [1616432715113, 1057445147575.2544], [1616436216234, 1067544548191.0143], [1616440245129, 1054592152559.9917], [1616443320990, 1045539840489.6487], [1616447443176, 1019731599864.7223], [1616451161572, 1008893227226.3318], [1616454129952, 1016862631494.5732], [1616457650275, 1020641820438.662], [1616461499721, 1021341100506.7543], [1616465192486, 1031004337786.0248], [1616468964967, 1021905683548.3175], [1616472478625, 1019514158381.2769], [1616476448041, 1013458787109.062], [1616481368907, 996753610139.8225], [1616484813671, 1005493418463.7837], [1616487997994, 1010577663538.9076], [1616491404414, 1014904891964.2437], [1616494870547, 1019821174888.8235], [1616498448432, 1020676396938.4679], [1616501569155, 1017932243600.3174], [1616506332522, 1032543845503.669], [1616508305393, 1033356251048.563], [1616513569375, 1027764985365.7881], [1616516688478, 1028018201778.6683], [1616519549518, 1039956652330.9736], [1616523356725, 1039065914953.6812], [1616526916776, 1034731655780.9882], [1616530641073, 1026308861691.5344], [1616534820666, 1017102800710.3696], [1616537049137, 1022080401909.7949], [1616541204682, 1017630425341.8208], [1616544826563, 1018692155025.9739], [1616549651113, 1009273239714.9967], [1616552677047, 1019239921901.1678], [1616556076322, 1016325282837.8864], [1616559993187, 1014952911314.4161], [1616563240600, 1006216384893.6323], [1616567128908, 1004109700622.5511], [1616570607949, 1036399673061.3173], [1616574953817, 1051748996152.6222], [1616578367528, 1054573807983.4565], [1616581465476, 1051150894505.4149], [1616585051563, 1055096299940.9496], [1616589094303, 1060537128118.9797], [1616591928462, 1061855952137.9143], [1616594564686, 1062227379852.0889], [1616599911730, 1054634993430.5518], [1616602949063, 1048251669811.192], [1616607306267, 1042450163633.1572], [1616609817036, 1049846649015.9138], [1616613541795, 1035699245106.0131], [1616617356094, 1013052162094.5802], [1616620449563, 1009738634367.5208], [1616623771940, 1003968644565.3348], [1616627566824, 981280567232.8397], [1616631592560, 977092173961.2955], [1616635050274, 982830614922.4331], [1616638599448, 976303300585.9022], [1616641585603, 975813389539.721], [1616646484651, 977435844425.1682], [1616649462508, 976909614833.3218], [1616653469585, 994230200620.4021], [1616657839908, 988134340182.6879], [1616660646420, 980179216529.5204], [1616663836016, 983802338618.3854], [1616668167385, 983920588804.8326], [1616670627143, 988145011415.8416], [1616674580444, 972141930108.1649], [1616678177475, 953541100989.3711], [1616682712318, 966225333479.3337], [1616685800136, 949000997788.967], [1616688154809, 954386513711.2004], [1616692333928, 961285349911.49], [1616697153290, 965332857590.4423], [1616704096702, 980357501500.4535], [1616705746524, 973702220570.3599], [1616708501557, 978492598671.6423], [1616710977264, 982686961686.6697], [1616715170367, 965798413379.1774], [1616718730278, 966142180913.8633], [1616721402519, 972999934561.306], [1616724339846, 977467460559.7024], [1616729705708, 981847530390.9534], [1616732366746, 978022799110.7747], [1616734928802, 985128795015.5527], [1616740351085, 982367570673.6399], [1616743920255, 983380869974.7379], [1616747371998, 1002889672866.2227], [1616749858691, 999098571823.7264], [1616753633203, 994393297639.9719], [1616756522614, 995930828016.9119], [1616760799797, 985578256488.1942], [1616763774928, 988511908415.9021], [1616768145895, 995102310245.3257], [1616771660225, 997283370580.3607], [1616776417918, 1001066398854.0464], [1616778973007, 1002707031906.6254], [1616781855019, 1006429550255.5702], [1616786457339, 1001592702610.961], [1616790404418, 1012513500712.8773], [1616793148935, 1011354209938.5939], [1616796447024, 1018636788985.1053], [1616799738147, 1015968006070.735], [1616804601964, 1035410233520.2952], [1616808701870, 1022257024346.2433], [1616812335025, 1024146770005.8811], [1616816023318, 1019433678206.5603], [1616819756494, 1027811492053.1387], [1616822396379, 1024407084961.3895], [1616825651956, 1029781567959.4358], [1616828654736, 1028557595873.8636], [1616833728998, 1025745232798.8257], [1616837022766, 1024190038447.5905], [1616841070909, 1024685870062.6742], [1616843142046, 1022373519478.666], [1616847323912, 1018571440211.1428], [1616851790517, 1014402698345.815], [1616853646083, 1017405384195.0004], [1616858297916, 1019486927939.3259], [1616861551509, 1026575010678.145], [1616865349655, 1049084095551.4951], [1616869975383, 1042323575766.038], [1616872108900, 1042402981059.5647], [1616875355222, 1041258580360.7764], [1616879351680, 1044032508084.058], [1616883782288, 1052230848315.1666], [1616887831953, 1049076912768.4271], [1616889955891, 1042184275332.6417], [1616893679594, 1045943560415.2225], [1616896947344, 1047479573202.9003], [1616900553334, 1042614518225.1982], [1616904149299, 1047147886912.6736], [1616908189740, 1048773724868.4681], [1616911471063, 1049343253430.0239], [1616914917120, 1043848758473.8014], [1616919303266, 1049706407017.9606], [1616922321672, 1050962999509.9457], [1616925870022, 1048983355262.9008], [1616929896171, 1045301800856.8882], [1616932860609, 1043871028106.907], [1616937175671, 1038871582750.035], [1616940625680, 1037967530512.339], [1616944108339, 1041539339152.2765], [1616947691245, 1050620946310.0695], [1616951068774, 1050079437003.6582], [1616954928589, 1045193133798.9143], [1616958617015, 1032581636923.9315], [1616962526306, 1028590153225.9077], [1616966246988, 1025888452944.6436], [1616969932159, 1028339480106.3445], [1616972824646, 1036763919859.1453], [1616976090633, 1042758085589.1571], [1616980673292, 1032042928261.5505], [1616984209069, 1031131603993.0164], [1616987612376, 1033962916012.2025], [1616990873356, 1034394782425.2095], [1616994720043, 1030618808679.3138], [1616997853633, 1029790526251.5894], [1617002332847, 1035510979000.4424], [1617005161174, 1045665364888.7618], [1617008584190, 1052832952547.642], [1617012514706, 1082822389092.6525], [1617016039392, 1081576930875.8649], [1617020008464, 1086084615811.5593], [1617023435434, 1083953796613.0696], [1617027039238, 1082887217078.0109], [1617030448415, 1085386519792.5282], [1617034003237, 1079956125327.7554], [1617038408185, 1077910296668.3364], [1617040952521, 1080018960651.3971], [1617045073768, 1078931096575.0332], [1617049013636, 1074879866978.347], [1617052693432, 1070098615173.7489], [1617055605633, 1075591267004.9517], [1617058954552, 1077326255415.1405], [1617063151785, 1074198993302.3815], [1617066190645, 1074712007714.5306], [1617069989206, 1072044390954.3463], [1617073345450, 1068900717731.6799], [1617076917393, 1068601933410.9568], [1617081398730, 1075252128335.6244], [1617084924632, 1074128146028.9259], [1617088397937, 1087340990851.3723], [1617091296417, 1084808999397.5079], [1617095909177, 1082875641005.4326], [1617099450146, 1113748614548.862], [1617102228966, 1098372053826.0762], [1617106091711, 1106893029477.3894], [1617110262532, 1104931043939.2253], [1617113144250, 1099674635407.2456], [1617117617213, 1098893476100.0918], [1617120554726, 1093857936440.1307], [1617124206604, 1095696592406.8401], [1617128449903, 1104903040934.7036], [1617131509300, 1098037449574.0131], [1617134860533, 1100231028497.8281], [1617138731266, 1094541903381.0188], [1617142004697, 1097588481726.4004], [1617146569750, 1095320610469.8468], [1617149030895, 1095293012032.8433], [1617153212294, 1101328578113.0566], [1617156766729, 1099078283200.8643], [1617160737753, 1093887699828.6267], [1617164018834, 1092428548464.8375], [1617167050380, 1096622673213.5919], [1617171210507, 1096174741048.5764], [1617175070790, 1115685379014.6187], [1617179778318, 1078099884027.6191], [1617182266092, 1078889358698.9613], [1617184960799, 1082046436397.5421], [1617189540784, 1078654354289.5537], [1617192383625, 1083600309122.5067], [1617196721671, 1086289080691.1849], [1617199979871, 1093902228161.6886], [1617203592186, 1101994755041.834], [1617206697727, 1109810599779.3306], [1617210620877, 1102170181418.0806], [1617214077919, 1107762668061.6602], [1617218053085, 1109363296638.956], [1617222020274, 1094981265115.052], [1617224539506, 1101057446151.645], [1617229195967, 1099903462040.8457], [1617231884037, 1096486747892.2977], [1617235645796, 1098127310946.8978], [1617238883818, 1104214670408.3032], [1617243551992, 1107145906329.4517], [1617246654378, 1102653299931.8179], [1617250098917, 1101784964546.339], [1617253995987, 1099787035973.1323], [1617257426896, 1098357133953.2183], [1617260961273, 1098837313109.5303], [1617264124564, 1097517121830.0273], [1617267920011, 1099900065090.3286], [1617271270041, 1097508343935.533], [1617275905591, 1091764157981.2175], [1617279222759, 1095211372350.8108], [1617283029260, 1101925176399.6047], [1617286242115, 1099943960572.3445], [1617290079854, 1102342391550.0244], [1617293474324, 1100666749362.9578], [1617297459658, 1096935633304.8055], [1617301174097, 1092268554794.2032], [1617304629938, 1095986994759.375], [1617307248425, 1101583816412.87], [1617311692196, 1098787247269.6096], [1617315051384, 1098215119660.031], [1617319092425, 1101580411195.1145], [1617322747251, 1097803230985.0869], [1617325572590, 1094090674146.698], [1617329206376, 1100320534168.7441], [1617333206284, 1121890335462.9937], [1617336414247, 1115707204895.2], [1617339741861, 1113401844169.7751], [1617343317637, 1111989849980.1553], [1617347874924, 1114101102891.7856], [1617351532469, 1111577313774.1096], [1617354938442, 1109579797222.0554], [1617359441974, 1112283296768.2183], [1617361387036, 1112106231047.779], [1617365336451, 1112006267718.6575], [1617369265342, 1109934117392.9263], [1617372358222, 1104243485963.138], [1617376597093, 1113837080883.7214], [1617379866125, 1110087654582.6172], [1617382926554, 1108583312151.9507], [1617386967819, 1105024395956.263], [1617390158842, 1102892126561.1843], [1617393747051, 1099649828496.6123], [1617397281964, 1095940113470.8352], [1617401451583, 1096967485174.3066], [1617404481989, 1099641282914.1125], [1617409726836, 1111510140937.0103], [1617411835470, 1106001622265.5793], [1617415980643, 1104843590503.2476], [1617419080079, 1107741126018.553], [1617424012999, 1106353697977.033], [1617426842032, 1108397964871.5002], [1617429724170, 1110033726779.7048], [1617433667443, 1108786656247.389], [1617437272135, 1107312495405.342], [1617441063755, 1102408956122.071], [1617444224902, 1106898386626.0942], [1617448421265, 1109019881401.1462], [1617451974389, 1103789435108.3572], [1617454956111, 1106665217599.9138], [1617458505822, 1108519605684.6362], [1617462432313, 1106229437949.231], [1617466406142, 1098942709748.0321], [1617469535587, 1098294340928.5441], [1617473312481, 1089617679847.3931], [1617476600222, 1090386156041.5321], [1617480124803, 1090737237416.7144], [1617483751714, 1085606153772.3226], [1617487620749, 1078696142226.576], [1617490948104, 1080063451000.6619], [1617494967288, 1066162738969.8163], [1617499464555, 1066162738969.8163], [1617503519510, 1069158440450.6744], [1617507438359, 1070746334010.51], [1617510725477, 1075335040543.3134], [1617512530592, 1074810371871.0153], [1617516184924, 1074061846582.0442], [1617519699291, 1072043512103.6554], [1617523430230, 1074567406904.8322], [1617526887410, 1075500609640.1063], [1617530492127, 1077604061088.3802], [1617534345051, 1077635150183.4893], [1617537718041, 1073573130741.7439], [1617541471040, 1080295618754.3412], [1617545018116, 1084865603092.6012], [1617548777105, 1085327826858.3751], [1617552453629, 1082297101757.2301], [1617555792369, 1084386115420.0476], [1617559278598, 1085235713337.2794], [1617563010833, 1084726272724.3265], [1617566635263, 1081414580190.0607], [1617570330282, 1084211164036.9331], [1617573737649, 1085742673087.683], [1617577464292, 1085327664490.6887], [1617581102876, 1087344280109.6896], [1617584508137, 1082412578398.0571], [1617588093176, 1077981139581.796], [1617591770029, 1076150055831.922], [1617595320295, 1076667911114.1628], [1617599157738, 1074369129459.3629], [1617602513434, 1067891802057.9816], [1617606276448, 1068723190872.9976], [1617609903254, 1067015118138.9302], [1617613337542, 1067534299433.03], [1617617309725, 1073451657446.2158], [1617620851328, 1075412317432.0105], [1617624394822, 1076574112490.8546], [1617627723529, 1083780834970.0282], [1617631245919, 1083074099544.2234], [1617634997096, 1100984850606.4004], [1617638464443, 1102262858355.787], [1617642210396, 1101520121344.8435], [1617645866889, 1099034257448.3899], [1617649314803, 1098885494313.4695], [1617652959467, 1101784272069.655], [1617656603399, 1098168675507.034], [1617660264773, 1094760181023.054], [1617663905558, 1099754092706.176], [1617667493830, 1098687703986.922], [1617672717177, 1106493043033.8088], [1617674588102, 1098940802942.2642], [1617678076379, 1098359594795.5427], [1617681629319, 1099198168146.2607], [1617685509685, 1098246376624.407], [1617689059020, 1099799580966.826], [1617692544445, 1100326435121.4883], [1617696404404, 1092583414715.4026], [1617699903949, 1092869322088.9916], [1617703438437, 1095564317852.0387], [1617707034510, 1093665727609.389], [1617710532087, 1092047665485.4795], [1617714271898, 1096710161962.9362], [1617717944437, 1091497487497.7195], [1617721479980, 1080300992621.5637], [1617724967811, 1083191333924.5856], [1617728770233, 1086176246176.0323], [1617732384643, 1088296723168.4326], [1617735975341, 1086991322396.8657], [1617739290391, 1085727236348.0714], [1617742907406, 1087249020528.6985], [1617746815588, 1082588429529.0432], [1617750169915, 1083335148670.6323], [1617754141720, 1084341670320.8142], [1617757381948, 1081192373860.3016], [1617761027788, 1074032489679.345], [1617764697270, 1080550917160.0304], [1617768137159, 1082741870246.4958], [1617771843193, 1075680059402.037], [1617775455622, 1088952296434.7516], [1617779041148, 1088110237437.2867], [1617782517775, 1080968770863.6086], [1617786171269, 1080072177320.1608], [1617789983349, 1074840059782.4253], [1617793533771, 1065102209026.6747], [1617796957648, 1046159377879.9685], [1617800860567, 1055919881164.0289], [1617804412316, 1060583382078.9581], [1617807682087, 1058722937717.0098], [1617811620156, 1052283073162.8334], [1617815119127, 1058732185373.4563], [1617818663110, 1047767790828.6619], [1617822165641, 1047974980808.3094], [1617825701377, 1044880742994.8739], [1617829625369, 1047567401735.8966], [1617832887344, 1054563545438.4438], [1617836511453, 1055141465645.6797], [1617840305905, 1050759681844.6099], [1617843897129, 1052796475220.5145], [1617847668329, 1057931871005.3961], [1617849911898, 1050304580274.9761], [1617852062936, 1053581065739.1831], [1617854819655, 1057367602166.514], [1617858135400, 1063937907952.2234], [1617862321266, 1063486447562.5076], [1617865595799, 1066117882522.5016], [1617868939834, 1067072461053.3829], [1617872695579, 1062791544469.1589], [1617876318306, 1060320425096.4872], [1617880044757, 1060317263016.3484], [1617882311000, 1058748509383.889]], "total_volumes": [[1615291675936, 59206406369.356766], [1615295061892, 58954474742.90262], [1615298528995, 59984336574.7133], [1615302492602, 59525553495.2943], [1615305685091, 58864540485.24883], [1615309711072, 58642574449.48969], [1615312925116, 58223783785.355515], [1615316475182, 58865484743.26318], [1615320219093, 58670009973.99557], [1615324025713, 57616172857.45733], [1615327756784, 57632990956.136314], [1615331003933, 58035896794.019005], [1615334452511, 57550095196.19977], [1615338399355, 58784513789.83856], [1615342051291, 56240825626.854965], [1615345459482, 57128607695.47491], [1615349140414, 56299919753.914276], [1615352842336, 56023721253.038734], [1615356519624, 55516863769.32886], [1615360161085, 55048787048.70599], [1615363337023, 55510731859.84894], [1615367115993, 55268829180.11823], [1615370533581, 55871389793.95406], [1615374098871, 55336534908.635765], [1615377856958, 55323272588.82281], [1615381333167, 55627860973.15018], [1615385046078, 57186668611.831764], [1615388718632, 57051256920.254875], [1615392077626, 57562328250.89425], [1615395662633, 58278563930.581314], [1615399439174, 59699021488.343025], [1615403261937, 60019544052.53504], [1615406514066, 60868319892.49084], [1615410273911, 61463687107.04808], [1615413961932, 63500125410.71846], [1615417405906, 63940113972.53999], [1615421095649, 63560545036.79726], [1615424680646, 62373950538.87534], [1615428373051, 61973584817.429405], [1615432476527, 60441155718.79699], [1615435404168, 59873324730.6106], [1615439228947, 59534155172.78656], [1615442990164, 59011766206.38099], [1615446210487, 59785303162.97147], [1615450496231, 59261417779.393105], [1615453886114, 60715646682.67264], [1615457046426, 60280917724.348854], [1615460942386, 61921501659.9404], [1615464381535, 63197525684.07903], [1615469553482, 64195623781.57074], [1615472196052, 64027862641.51515], [1615475230158, 64216287131.21584], [1615478507405, 64400610332.05858], [1615482262048, 63861547602.35098], [1615485936365, 63170133194.299324], [1615489469411, 64863180805.55349], [1615493229355, 64049864735.53532], [1615496689791, 64170098707.85679], [1615500590281, 64183400331.496735], [1615504294730, 64776449488.85629], [1615507564331, 64557800714.411156], [1615510949504, 64345871061.17018], [1615514568188, 63604451373.6962], [1615518165727, 63980002649.98165], [1615521759447, 63518083936.88802], [1615525402650, 63469589577.50127], [1615529119586, 63957267338.50053], [1615532500517, 63432462022.13669], [1615536188030, 63032006687.85533], [1615540003028, 62040305342.81665], [1615543401269, 61920044016.63766], [1615547099001, 60697460686.513466], [1615550693613, 60034411561.98672], [1615554477464, 59398027855.67688], [1615557982935, 61474724320.76592], [1615561467823, 61613216966.25686], [1615564990462, 62337540849.604836], [1615568707665, 62738338933.68374], [1615572337980, 62036013865.31022], [1615576045348, 61507674695.41285], [1615579530792, 61087321779.48395], [1615583186932, 61147739574.40268], [1615586542180, 60844494888.702705], [1615590289170, 60638122724.742035], [1615594065134, 59806733588.693886], [1615598933479, 58427668732.90784], [1615601083816, 58756747483.575], [1615604706033, 58697732072.27906], [1615608073337, 58693755848.04448], [1615611727644, 58488742179.00474], [1615615245875, 58097174673.92435], [1615619017089, 58246155109.578735], [1615622846031, 58603720160.931725], [1615626207959, 58691182953.109795], [1615630029797, 58729980453.00157], [1615633354780, 64410651645.96035], [1615636872736, 67709982122.08802], [1615640638180, 69417600658.35393], [1615644257829, 66940366057.564674], [1615647958119, 67627263591.59044], [1615651298495, 66384478249.98179], [1615655299897, 64885030779.45475], [1615658775048, 65256947600.165886], [1615662215300, 65112062769.1604], [1615665663669, 65449342919.71286], [1615669370611, 66783812205.62155], [1615672941010, 65435396850.143654], [1615676684768, 66912429759.68755], [1615680260839, 63816753924.77825], [1615683628338, 66521344130.8744], [1615687299096, 67147476793.931], [1615690915238, 66855220889.757416], [1615694625648, 67053722732.88853], [1615698300422, 66287041602.45906], [1615701673193, 67043866881.22477], [1615705265674, 67304436501.383415], [1615708931347, 66430879494.552986], [1615712510410, 63117500416.13352], [1615716189205, 65617566236.17864], [1615719804272, 59836096992.58146], [1615723407005, 58066627813.732445], [1615726882117, 56129732617.2631], [1615730647326, 54859874066.66665], [1615734370515, 54304520127.16307], [1615737955740, 53918575381.93474], [1615741290536, 53413823453.3841], [1615744838636, 52986193293.534676], [1615748648066, 52751361510.8584], [1615752244071, 49551313584.22919], [1615755616959, 49980146962.57776], [1615759274177, 48715802252.79685], [1615762860625, 48439265007.42776], [1615766854967, 48071938731.44986], [1615770321846, 49549787475.42801], [1615773806734, 50145839467.72012], [1615777491734, 50172774655.85087], [1615780890985, 50150643334.49859], [1615784729970, 50022143077.92417], [1615788373369, 50104657094.618324], [1615791800980, 51511782768.85972], [1615795307712, 54959603590.910324], [1615798939055, 56048774235.25231], [1615802618633, 60516480934.02079], [1615806067855, 64070736808.25892], [1615809822991, 63749846032.34874], [1615813685223, 66937109811.51152], [1615816915926, 66288615168.27822], [1615820603360, 67174005410.3204], [1615824063714, 67915486775.695786], [1615827670769, 68087924863.53465], [1615831332017, 68674838177.6244], [1615835309404, 69587974012.78552], [1615838723378, 70465268989.93274], [1615842060604, 70639387049.47968], [1615845693652, 71523965164.10658], [1615849500955, 71216528201.472], [1615853044073, 70611079922.93135], [1615856537727, 70341886605.09314], [1615860036744, 73151798402.95361], [1615863985754, 73778160171.75287], [1615867315087, 74942916667.57852], [1615870980592, 75243224632.27742], [1615874489240, 74861048245.32918], [1615878343549, 76014307549.27777], [1615882087435, 73721945124.25925], [1615885483752, 73899075468.5661], [1615888972630, 68513028454.24088], [1615892837634, 66930555685.60541], [1615896108767, 66054179371.40269], [1615899778721, 64135294803.31619], [1615903304861, 63619869517.06526], [1615907009565, 63059838628.89763], [1615910760509, 62705871160.90011], [1615914096819, 61610902465.11318], [1615918221233, 61622433974.59093], [1615921474642, 61919556098.64152], [1615925211062, 60782053531.89615], [1615928719695, 63066147486.04982], [1615932105297, 63165902570.040596], [1615935815840, 63236156479.40486], [1615939416579, 63219904254.35453], [1615943078701, 59444968247.25523], [1615946594276, 58013835158.05872], [1615950220730, 57523105369.23186], [1615953805501, 56594707574.54546], [1615957272652, 56612033059.83586], [1615960894642, 54138405081.00793], [1615964517436, 55368382701.25069], [1615968470393, 54112193420.83664], [1615971661135, 53564214707.74633], [1615975321627, 53285634262.8959], [1615978919276, 53929347473.80125], [1615982850778, 53468540925.199646], [1615986248755, 54737265822.959885], [1615990271893, 54302768435.88795], [1615993315980, 54554870782.15687], [1615997326220, 55482248169.54126], [1616000437382, 55416682132.62685], [1616004102938, 54527494683.52085], [1616008030978, 58055976702.77863], [1616011240836, 59975323931.49761], [1616015059385, 60105457643.53245], [1616019002357, 61699169599.58144], [1616022200886, 62330339859.168655], [1616026004512, 63647269890.97583], [1616029519412, 64230374549.311325], [1616033225896, 64563146029.65721], [1616036888067, 64694426107.748795], [1616040190344, 62872622661.227776], [1616043933137, 64518771161.32982], [1616047298161, 64798516195.33772], [1616051218150, 64211077016.21204], [1616054460512, 63845324977.97669], [1616058058686, 63707626449.17907], [1616061849086, 62971324389.75222], [1616065381728, 62763440809.745384], [1616069247157, 62294162913.58304], [1616072959580, 62013582806.57875], [1616076434490, 60717268203.064575], [1616079925050, 61018562079.07211], [1616085485393, 63750873846.43963], [1616089010968, 65348109690.37053], [1616092047998, 64197677477.38224], [1616095713523, 62165048031.05816], [1616099493338, 62023571451.07167], [1616102991808, 61750369913.60588], [1616106426733, 60393181446.4457], [1616110197741, 59505154731.51079], [1616113851842, 57831098604.33174], [1616116797687, 58637800994.78784], [1616120616139, 58900403718.19221], [1616124339430, 58630833745.1966], [1616128447326, 58650915297.657], [1616131796029, 58900945427.338135], [1616135129947, 59427541485.33789], [1616138771830, 59434927816.341736], [1616142682924, 59455835153.10368], [1616145774807, 60091053793.80042], [1616149243246, 59202812942.80126], [1616153134889, 58936711107.33436], [1616157036034, 60071175233.72073], [1616159327042, 59376874701.931725], [1616163739842, 59573424504.163925], [1616167906864, 59657238582.90092], [1616171012204, 57066704364.610954], [1616175237724, 55215024517.434906], [1616178074629, 54267585718.81036], [1616180955307, 53803560153.92041], [1616185851441, 52706939780.20558], [1616189275261, 52018925548.35656], [1616193197295, 52625664646.28312], [1616195834783, 52209835311.3765], [1616200007470, 51692369707.567604], [1616203132891, 51190101109.38365], [1616207252712, 51409889500.151375], [1616209712003, 51811307488.272804], [1616214261186, 51883593318.30482], [1616217015786, 50310416383.70142], [1616220073932, 50957407076.699326], [1616223994014, 50803777678.87308], [1616228163087, 50150997878.39094], [1616231008311, 50962442646.94871], [1616235862921, 50422883718.44458], [1616238241353, 50295330764.75294], [1616242738615, 50690667192.31], [1616247290948, 51891419843.60567], [1616249855404, 51753678860.98692], [1616254189107, 53350054058.04287], [1616257413046, 52057206513.98553], [1616260711195, 52706556950.42383], [1616263477335, 53134667383.99295], [1616268127212, 53302711496.77477], [1616271721045, 52740977018.23956], [1616275325249, 52881265604.0584], [1616279650679, 52801769672.93442], [1616282993885, 53618090110.23076], [1616285979902, 55079121588.122345], [1616288605657, 56717563145.911064], [1616292243572, 57210409619.65553], [1616296011828, 57200019806.16421], [1616299344468, 57736449948.38582], [1616303279836, 58416641917.6193], [1616306986124, 59184454787.11481], [1616310524524, 59383054514.73603], [1616314074468, 58494907680.58114], [1616317251670, 59275939428.11574], [1616321597563, 60307143150.16196], [1616324937717, 61607302676.17213], [1616328462216, 61482992107.14128], [1616331656647, 61340234602.87569], [1616335676788, 61361764460.7787], [1616339264204, 60056269050.87294], [1616343092715, 59074185835.376274], [1616346290056, 59324276023.4924], [1616350483787, 58574598341.9341], [1616353767776, 58856733187.907906], [1616357042749, 59083744630.90941], [1616360458951, 57839960078.227325], [1616364160603, 58434664429.984474], [1616367728232, 57670994247.4563], [1616371567678, 55040960324.45798], [1616375641815, 52746525655.79651], [1616379147652, 54005059892.862946], [1616382299973, 53810382649.98189], [1616386311282, 54246859927.79525], [1616389457772, 53739771076.48801], [1616393194685, 52082735110.27238], [1616397271283, 52956396972.8402], [1616400290989, 53048454298.371376], [1616404208628, 52707639088.85587], [1616407470800, 50514096154.476135], [1616411227987, 51607249903.30179], [1616414760916, 50989339672.16936], [1616418868346, 52286738605.4619], [1616422484218, 52799562386.918335], [1616425317074, 53528406394.07023], [1616429285641, 53230765436.37852], [1616432715113, 52671704594.636246], [1616436216234, 54412390082.6563], [1616440245129, 54668900416.47575], [1616443320990, 55168896203.36882], [1616447443176, 57107553898.354904], [1616451161572, 58891243217.22166], [1616454129952, 61302230409.588524], [1616457650275, 62001716794.84347], [1616461499721, 62249432915.45296], [1616465192486, 63820805916.11539], [1616468964967, 63615373468.58025], [1616472478625, 63080690614.45109], [1616476448041, 63756260909.08318], [1616481368907, 66384503737.990746], [1616484813671, 67230170009.680046], [1616487997994, 66059297906.26647], [1616491404414, 67183540391.24799], [1616494870547, 66824887386.677], [1616498448432, 66108090869.93829], [1616501569155, 67335683745.255516], [1616506332522, 66789828394.352425], [1616508305393, 67658232399.12309], [1616513569375, 66421738931.91439], [1616516688478, 66300646709.603645], [1616519549518, 68177453081.59436], [1616523356725, 67149992041.667854], [1616526916776, 67957707244.679405], [1616530641073, 66209315529.774254], [1616534820666, 63087864972.483215], [1616537049137, 63222680253.41875], [1616541204682, 59736197379.76941], [1616544826563, 60015909646.26715], [1616549651113, 60147305095.42153], [1616552677047, 60258333752.43399], [1616556076322, 59772465733.096985], [1616559993187, 60171662185.71609], [1616563240600, 59156685637.61183], [1616567128908, 57140747782.4376], [1616570607949, 59269536728.446014], [1616574953817, 60290078059.210365], [1616578367528, 61661298721.01536], [1616581465476, 62767099605.18544], [1616585051563, 63526541905.84619], [1616589094303, 62667108320.169975], [1616591928462, 62522606954.85812], [1616594564686, 63681050693.765625], [1616599911730, 63198393185.266884], [1616602949063, 61461458696.56972], [1616607306267, 60890916782.21832], [1616609817036, 61511497224.26847], [1616613541795, 60785812091.632385], [1616617356094, 61427825004.55801], [1616620449563, 63599766240.6646], [1616623771940, 63712678630.308304], [1616627566824, 69485981424.38214], [1616631592560, 74582445962.0476], [1616635050274, 76637230465.6906], [1616638599448, 64892800920.256134], [1616641585603, 65967169175.54279], [1616646484651, 66607974881.81982], [1616649462508, 66880143129.57717], [1616653469585, 68224458864.45215], [1616657839908, 64302130760.55643], [1616660646420, 64828892138.566345], [1616663836016, 63043359716.312004], [1616668167385, 64133726884.30923], [1616670627143, 62984934963.211784], [1616674580444, 62970706338.477486], [1616678177475, 65540667352.09086], [1616682712318, 67193927120.22528], [1616685800136, 68312090300.887344], [1616688154809, 69741130053.25685], [1616692333928, 71361703440.31718], [1616697153290, 72071716515.6815], [1616704096702, 72360586085.61575], [1616705746524, 69854011476.68016], [1616708501557, 69394978495.75574], [1616710977264, 67580850959.58072], [1616715170367, 62759174959.667046], [1616718730278, 63402237491.68179], [1616721402519, 63917360931.32326], [1616724339846, 63256821458.152405], [1616729705708, 60966448254.59268], [1616732366746, 59849290792.15175], [1616734928802, 61115638166.15277], [1616740351085, 59932822470.33899], [1616743920255, 60920113040.66178], [1616747371998, 63595230018.67892], [1616749858691, 63803450948.89763], [1616753633203, 62543850869.89708], [1616756522614, 62683178518.712814], [1616760799797, 63161827524.2029], [1616763774928, 60557886995.893845], [1616768145895, 58067405696.78151], [1616771660225, 57849710470.32358], [1616776417918, 55167145369.333626], [1616778973007, 55848437245.9368], [1616781855019, 56114544690.084206], [1616786457339, 54178877628.37616], [1616790404418, 55299942514.6929], [1616793148935, 55083534141.79329], [1616796447024, 55295807901.331955], [1616799738147, 54548783363.451355], [1616804601964, 56060260236.266014], [1616808701870, 55051400981.474266], [1616812335025, 54783677978.867195], [1616816023318, 53075226120.27978], [1616819756494, 53733580164.39409], [1616822396379, 52958013733.993195], [1616825651956, 51807706416.72101], [1616828654736, 52451675609.468315], [1616833728998, 49056709046.12132], [1616837022766, 48257925095.58935], [1616841070909, 47958766076.643814], [1616843142046, 48142629626.53372], [1616847323912, 46084986608.69404], [1616851790517, 45321885213.01507], [1616853646083, 46170104492.00304], [1616858297916, 46537601821.68484], [1616861551509, 46695951585.60975], [1616865349655, 46955259592.21249], [1616869975383, 46450046176.49793], [1616872108900, 47265045930.610916], [1616875355222, 46989993312.81715], [1616879351680, 46108314352.658875], [1616883782288, 46661195677.19528], [1616887831953, 48116298913.352234], [1616889955891, 47248737878.02399], [1616893679594, 47294397982.08005], [1616896947344, 46882083035.8547], [1616900553334, 47557756078.016304], [1616904149299, 48309176341.44217], [1616908189740, 49618479213.27872], [1616911471063, 49683880492.42065], [1616914917120, 49451309668.82514], [1616919303266, 49957034100.241356], [1616922321672, 50817827387.279625], [1616925870022, 51017819991.36044], [1616929896171, 52053824203.87116], [1616932860609, 51983993040.66072], [1616937175671, 51606454659.91344], [1616940625680, 51923015298.22979], [1616944108339, 52187239504.65653], [1616947691245, 52727615769.102646], [1616951068774, 51349780520.67277], [1616954928589, 49621429950.72931], [1616958617015, 50268058497.70149], [1616962526306, 51116278929.23025], [1616966246988, 50576033777.775665], [1616969932159, 49807352440.36131], [1616972824646, 50325490678.44892], [1616976090633, 49971308993.12914], [1616980673292, 48600804189.40788], [1616984209069, 48230057200.71871], [1616987612376, 48091919434.19909], [1616990873356, 47747239540.828636], [1616994720043, 47944561055.81619], [1616997853633, 48145598035.97439], [1617002332847, 48804502711.689026], [1617005161174, 49380800866.55208], [1617008584190, 52069213774.55867], [1617012514706, 54105609181.964294], [1617016039392, 54815625766.53542], [1617020008464, 55310132347.29762], [1617023435434, 54339771038.50802], [1617027039238, 55315641727.635994], [1617030448415, 55413406475.021736], [1617034003237, 56757959536.78625], [1617038408185, 57503267268.68102], [1617040952521, 57201383626.565704], [1617045073768, 56531339248.69121], [1617049013636, 57124381201.053665], [1617052693432, 57400972577.684296], [1617055605633, 56559283098.19798], [1617058954552, 56754311417.53593], [1617063151785, 57255678917.91131], [1617066190645, 58260729623.077484], [1617069989206, 58235149012.19252], [1617073345450, 56989870542.01504], [1617076917393, 57946347086.12203], [1617081398730, 59198731780.49057], [1617084924632, 57824623422.648796], [1617088397937, 59507051710.356125], [1617091296417, 58116385816.68823], [1617095909177, 57091603927.976685], [1617099450146, 58164250849.054405], [1617102228966, 56916680505.472404], [1617106091711, 58170448551.57581], [1617110262532, 58004301801.933334], [1617113144250, 58227176337.374], [1617117617213, 58034804828.76348], [1617120554726, 56586791441.268776], [1617124206604, 54819075735.54196], [1617128449903, 55228559214.168], [1617131509300, 53747759372.0077], [1617134860533, 54706722706.382164], [1617138731266, 53219729072.07603], [1617142004697, 52987276003.55791], [1617146569750, 52675731105.80641], [1617149030895, 52387542500.621956], [1617153212294, 52457767551.3032], [1617156766729, 52641464562.1274], [1617160737753, 51608280420.69627], [1617164018834, 51706388376.429726], [1617167050380, 51366665686.018715], [1617171210507, 50957022118.20826], [1617175070790, 53503800401.54426], [1617179778318, 54953848580.83894], [1617182266092, 56059711134.9352], [1617184960799, 54173389092.64027], [1617189540784, 53534381447.67926], [1617192383625, 52158791958.893234], [1617196721671, 51808897443.19952], [1617199979871, 52317858744.14403], [1617203592186, 52661912614.76909], [1617206697727, 51051275705.87759], [1617210620877, 50528988833.924706], [1617214077919, 52191033783.54361], [1617218053085, 52389810944.21751], [1617222020274, 54229360590.50724], [1617224539506, 54097229867.883224], [1617229195967, 55185480873.09236], [1617231884037, 55609231113.37402], [1617235645796, 56284050048.79175], [1617238883818, 57217207042.48379], [1617243551992, 58322614718.848785], [1617246654378, 59555544523.85715], [1617250098917, 61715335086.06074], [1617253995987, 62343813366.72511], [1617257426896, 62971784168.9233], [1617260961273, 63099620250.3395], [1617264124564, 61798844879.46849], [1617267920011, 60412052851.86889], [1617271270041, 59644341406.08112], [1617275905591, 60332653804.63571], [1617279222759, 59955229441.24919], [1617283029260, 61233322730.30951], [1617286242115, 59421027264.03748], [1617290079854, 59561568984.88269], [1617293474324, 57810076858.23093], [1617297459658, 57163500670.057625], [1617301174097, 57048786486.36901], [1617304629938, 57853678184.01013], [1617307248425, 57454935847.41254], [1617311692196, 55906661845.44235], [1617315051384, 54886641476.9329], [1617319092425, 54559252627.08951], [1617322747251, 54397354685.42925], [1617325572590, 55185832721.16723], [1617329206376, 53890060924.79522], [1617333206284, 58874826895.358376], [1617336414247, 59355790719.99961], [1617339741861, 59042919634.57618], [1617343317637, 57233842539.58154], [1617347874924, 57027276020.20292], [1617351532469, 56422270008.760056], [1617354938442, 54501223464.889915], [1617359441974, 54451178743.22559], [1617361387036, 54167843842.00953], [1617365336451, 52570298693.34192], [1617369265342, 51439615701.83562], [1617372358222, 51436229152.35063], [1617376597093, 53661404417.315956], [1617379866125, 53438684024.02572], [1617382926554, 53485677363.81018], [1617386967819, 52725496101.74052], [1617390158842, 51151408850.93906], [1617393747051, 50372870000.89148], [1617397281964, 50463495599.19394], [1617401451583, 50639854157.16094], [1617404481989, 50842267688.37058], [1617409726836, 52609711893.95429], [1617411835470, 51593457113.94056], [1617415980643, 50943535006.40953], [1617419080079, 48736366285.3088], [1617424012999, 46795165011.49196], [1617426842032, 46485225170.4109], [1617429724170, 46762862672.5606], [1617433667443, 47020143500.798294], [1617437272135, 46621102381.96073], [1617441063755, 48370023027.08831], [1617444224902, 48602431848.30714], [1617448421265, 48672310717.72424], [1617451974389, 49560630090.501114], [1617454956111, 48222340121.45792], [1617458505822, 47992218628.547966], [1617462432313, 47106393843.49809], [1617466406142, 46461427599.52945], [1617469535587, 46519564924.90572], [1617473312481, 48570781812.59221], [1617476600222, 49988487243.70637], [1617480124803, 49949263830.673836], [1617483751714, 50692117115.37594], [1617487620749, 51227928169.925835], [1617490948104, 52988296536.79219], [1617494967288, 53117535590.35953], [1617499464555, 53897987092.61856], [1617503519510, 55730953677.6945], [1617507438359, 54671046032.35558], [1617510725477, 55003651955.65936], [1617512530592, 55034424725.24535], [1617516184924, 54851420638.96671], [1617519699291, 54680866474.94191], [1617523430230, 54949234771.19873], [1617526887410, 54090300688.2287], [1617530492127, 53963441831.68008], [1617534345051, 53517655138.39556], [1617537718041, 54456529461.07534], [1617541471040, 54884673887.56173], [1617545018116, 55625159648.09316], [1617548777105, 55829279806.1349], [1617552453629, 55872311391.35547], [1617555792369, 55143250097.66394], [1617559278598, 53518823835.02951], [1617563010833, 51420664500.815], [1617566635263, 50649358076.05516], [1617570330282, 49762378097.882645], [1617573737649, 49071592154.250595], [1617577464292, 47486609963.00907], [1617581102876, 46156767978.177345], [1617584508137, 44714763916.72378], [1617588093176, 43587438282.74045], [1617591770029, 43726049037.77901], [1617595320295, 43802577297.40571], [1617599157738, 43853389670.89035], [1617602513434, 43838389708.49397], [1617606276448, 44325279742.16603], [1617609903254, 44823073126.978165], [1617613337542, 44725809808.72623], [1617617309725, 45107623082.913734], [1617620851328, 45577518830.42011], [1617624394822, 45796497530.36607], [1617627723529, 46248230574.167984], [1617631245919, 46733359807.41449], [1617634997096, 48849622936.1406], [1617638464443, 49679933747.71702], [1617642210396, 50218674780.46233], [1617645866889, 50871721834.69142], [1617649314803, 51469053998.09348], [1617652959467, 52295840862.89153], [1617656603399, 53262832451.75883], [1617660264773, 53707129254.61941], [1617663905558, 54453157124.3066], [1617667493830, 55060547644.94518], [1617672717177, 56069566347.1445], [1617674588102, 56478788509.167984], [1617678076379, 55904618582.18011], [1617681629319, 56233501583.30366], [1617685509685, 56023326022.047806], [1617689059020, 55961107589.27233], [1617692544445, 55385167119.2797], [1617696404404, 55316601387.0113], [1617699903949, 51324918052.91379], [1617703438437, 57652274637.53841], [1617707034510, 58807965769.13632], [1617710532087, 59259298860.38309], [1617714271898, 60694962024.88077], [1617717944437, 59706742205.00158], [1617721479980, 61777681319.01381], [1617724967811, 61902834484.62076], [1617728770233, 61515137575.1006], [1617732384643, 60719271389.95637], [1617735975341, 61153166637.87089], [1617739290391, 61299686905.350525], [1617742907406, 61207171444.06409], [1617746815588, 61013872439.90613], [1617750169915, 61525721553.80233], [1617754141720, 61238654742.70642], [1617757381948, 60471525223.70598], [1617761027788, 60478916707.23359], [1617764697270, 61016167312.27499], [1617768137159, 61593094904.35026], [1617771843193, 62637744841.26653], [1617775455622, 64227811219.59257], [1617779041148, 65326239045.66472], [1617782517775, 65886784134.74165], [1617786171269, 64881960240.11829], [1617789983349, 66550472891.32576], [1617793533771, 67553812265.0499], [1617796957648, 67750482833.94912], [1617800860567, 68965515732.18701], [1617804412316, 69241135533.83807], [1617807682087, 66924905901.72875], [1617811620156, 65667699942.5434], [1617815119127, 66864196419.013985], [1617818663110, 66896751563.64456], [1617822165641, 67166487759.68756], [1617825701377, 68299516191.63025], [1617829625369, 68684974186.09457], [1617832887344, 68337078955.85483], [1617836511453, 68139803348.51239], [1617840305905, 67617613532.43307], [1617843897129, 68133032371.23059], [1617847668329, 67041251823.79599], [1617849911898, 66839852088.303925], [1617852062936, 66795399598.89486], [1617854819655, 66641932534.311714], [1617858135400, 66346403554.22701], [1617862321266, 64634545618.74917], [1617865595799, 64679536394.7511], [1617868939834, 63356612147.46929], [1617872695579, 62138445603.12024], [1617876318306, 59609184802.1315], [1617880044757, 58376438433.96351], [1617882311000, 55519661826.70237]]} \ No newline at end of file diff --git a/tests/test_coingecko_crypto.py b/tests/test_coingecko_crypto.py index 87d301459e0..e25106daf36 100644 --- a/tests/test_coingecko_crypto.py +++ b/tests/test_coingecko_crypto.py @@ -1,4 +1,6 @@ from unittest import mock, TestCase +import json +from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.coin_api import load # pylint: disable=unused-import @@ -9,6 +11,25 @@ class TestCoinGeckoAPI(TestCase): "gamestonk_terminal.cryptocurrency.coin_api.CoinGeckoAPI.get_coin_market_chart_by_id" ) def test_coin_api_load(self, mock_load): - coin, _ = load(["-c", "bitcoin"]) + """ + Mock load function through get_coin_market_chart_by_id. + Mock returns a dict saved as .json + + """ + with open("tests/data/btc_usd_test_data.json") as f: + sample_return = json.load(f) + + mock_load.return_value = sample_return + coin, mock_return = load(["-c", "bitcoin"]) self.assertEqual(coin, "bitcoin") self.assertTrue(mock_load.called) + self.assertTrue(mock_return.shape == (722, 2)) + + def test_coin(self): + """Test that pycoingecko retreives the major coins""" + + coins = CoinGeckoAPI().get_coins() + coin_list = [coin["id"] for coin in coins] + test_coins = ["bitcoin", "ethereum", "dogecoin"] + for test in test_coins: + self.assertIn(test, coin_list) From bdf2b77cef46252f1c3c4234171e95e16237dca2 Mon Sep 17 00:00:00 2001 From: Jamie Date: Thu, 8 Apr 2021 08:53:05 -0400 Subject: [PATCH 04/17] spellcheck --- tests/test_coingecko_crypto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_coingecko_crypto.py b/tests/test_coingecko_crypto.py index e25106daf36..5f20e2e04d1 100644 --- a/tests/test_coingecko_crypto.py +++ b/tests/test_coingecko_crypto.py @@ -26,7 +26,7 @@ class TestCoinGeckoAPI(TestCase): self.assertTrue(mock_return.shape == (722, 2)) def test_coin(self): - """Test that pycoingecko retreives the major coins""" + """Test that pycoingecko retrieves the major coins""" coins = CoinGeckoAPI().get_coins() coin_list = [coin["id"] for coin in coins] From e49c754f500c44a8f660a6e2743ffb5f4529d78c Mon Sep 17 00:00:00 2001 From: didier Date: Thu, 8 Apr 2021 22:31:14 +0100 Subject: [PATCH 05/17] Use Finviz to get similar companies based on Industry Sector Country --- ROADMAP.md | 3 +- .../comparison_analysis/README.md | 8 ++- .../comparison_analysis/ca_controller.py | 66 ++++++++++++++----- .../comparison_analysis/yahoo_finance_api.py | 41 +++++++++--- 4 files changed, 89 insertions(+), 29 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 2e5c86b6dd2..36bddcdafbf 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -108,9 +108,10 @@ * [x] Add multi-ticker historical data comparison (@didier) - [PR #141](https://github.com/DidierRLopes/GamestonkTerminal/pull/141) * [x] Add multi-ticker financials comparison (@didier) - [PR #237](https://github.com/DidierRLopes/GamestonkTerminal/pull/237) * [x] Add multi-ticker sentiment comparison (@didier) - [PR #250](https://github.com/DidierRLopes/GamestonkTerminal/pull/250) +* [x] Get similar companies from Finviz based on Industry and Sector (and possibly country) from Finviz (@didier) - [PR #321](https://github.com/DidierRLopes/GamestonkTerminal/pull/321) **NEXT** -* [ ] Get similar companies from Finviz based on Industry and Sector (and possibly country) from Finviz (@didier) + * [ ] Perform quick screening across similar companies based on key metrics (overview, performance, financial, valuation) from Finviz (@didier) --- diff --git a/gamestonk_terminal/comparison_analysis/README.md b/gamestonk_terminal/comparison_analysis/README.md index e4d6127d54c..19210c56f74 100644 --- a/gamestonk_terminal/comparison_analysis/README.md +++ b/gamestonk_terminal/comparison_analysis/README.md @@ -3,7 +3,7 @@ This menu aims to compare a pre-loaded stock with similar companies, and the usage of the following commands along with an example will be exploited below. * [get](#get) - * get similar companies [Polygon] + * get similar companies [Finviz or Polygon] * [select](#select) * select similar companies * [historical](#historical) @@ -25,11 +25,13 @@ This menu aims to compare a pre-loaded stock with similar companies, and the usa ## get ```text -get +get [-p] [--nocountry] ``` -Get similar companies to compare with. [Source: Polygon] +Get similar companies to compare with. [Source: Finviz by default] +* -p : get similar companies using polygon source. Default False, i.e. using Finviz source. +* --nocountry : when getting similar companies from Finviz, we filter by same Industry, Sector and Country. However, if we don't want to filter by same country we can set this flag. For this flag to work, the `-p` flag can't be selected ## select diff --git a/gamestonk_terminal/comparison_analysis/ca_controller.py b/gamestonk_terminal/comparison_analysis/ca_controller.py index dfd8f522d34..4ed4f897364 100644 --- a/gamestonk_terminal/comparison_analysis/ca_controller.py +++ b/gamestonk_terminal/comparison_analysis/ca_controller.py @@ -9,6 +9,7 @@ import pandas as pd from matplotlib import pyplot as plt from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal import config_terminal as cfg +from finvizfinance.screener.overview import Overview from gamestonk_terminal.helper_funcs import get_flair, parse_known_args_and_warn from gamestonk_terminal.comparison_analysis import yahoo_finance_api as yf_api from gamestonk_terminal.comparison_analysis import market_watch_api as mw_api @@ -47,7 +48,7 @@ class ComparisonAnalysisController: ): """Constructor""" self.similar = similar - self.user = user + self.user = "" self.stock = stock self.ticker = ticker self.start = start @@ -71,12 +72,10 @@ class ComparisonAnalysisController: else: print(f"\n{s_intraday} Stock: {self.ticker}") - s_similar_source = ("Polygon API", "User")[self.user] - if self.similar: - print(f"[{s_similar_source}] Similar Companies: {', '.join(self.similar)}") - else: - print(f"No similar companies [{s_similar_source}]") + print(f"[{self.user}] Similar Companies: {', '.join(self.similar)}") + #else: + # print(f"No similar companies [{self.user}]") print("\nComparison Analysis Mode:") print(" help show this comparison analysis menu again") @@ -106,22 +105,59 @@ class ComparisonAnalysisController: prog="get", description="""Get similar companies to compare with.""", ) + parser.add_argument( + "-p", + "--polygon", + action="store_true", + default=False, + dest="b_polygon", + help="Polygon data source flag.", + ) + + # If polygon source not selected, the user may want to get + # similar companies based on Industry and Sector only, and not + # on the fact that they are based on the same country + if '-p' not in other_args and '--polygon' not in other_args: + parser.add_argument( + "--nocountry", + action="store_true", + default=False, + dest="b_no_country", + help="Similar stocks from finviz using only Industry and Sector.", + ) try: ns_parser = parse_known_args_and_warn(parser, other_args) if not ns_parser: return - result = requests.get( - f"https://api.polygon.io/v1/meta/symbols/{self.ticker.upper()}/company?&apiKey={cfg.API_POLYGON_KEY}" - ) + if ns_parser.b_polygon: + result = requests.get( + f"https://api.polygon.io/v1/meta/symbols/{self.ticker.upper()}/company?&apiKey={cfg.API_POLYGON_KEY}" + ) + + if result.status_code == 200: + self.similar = result.json()["similar"] + self.user = "Polygon" + else: + print(result.json()["error"]) - if result.status_code == 200: - self.similar = result.json()["similar"] - print(f"[Polygon API] Similar Companies: {', '.join(self.similar)}") - self.user = False else: - print(result.json()["error"]) + if ns_parser.b_no_country: + compare_list = ['Sector', 'Industry'] + else: + compare_list = ['Sector', 'Industry', 'Country'] + + self.similar = Overview().compare(self.ticker, compare_list, verbose=0)['Ticker'].to_list() + self.user = "Finviz" + + if self.similar: + print(f"\n[{self.user}] Similar Companies: {', '.join(self.similar)}") + + if len(self.similar) > 10: + print("\nThe limit of stocks to compare with are 10. Hence, the similar stocks list will be:") + self.similar = self.similar[:10] + print(', '.join(self.similar)) except Exception as e: print(e) @@ -157,7 +193,7 @@ class ComparisonAnalysisController: return self.similar = ns_parser.l_similar - self.user = True + self.user = "User" except Exception as e: print(e) diff --git a/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py b/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py index 163ff3c09d7..09f4330cc50 100644 --- a/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py +++ b/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py @@ -81,22 +81,43 @@ def historical(l_args, df_stock, s_ticker, s_start, s_interval, similar): plt.figure(figsize=plot_autoscale(), dpi=PLOT_DPI) plt.title(f"Similar companies to {s_ticker}") - df_stock = yf.download(s_ticker, start=s_start, progress=False) + df_stock = yf.download(s_ticker, start=s_start, progress=False, threads=False) plt.plot( df_stock.index, df_stock[d_candle_types[ns_parser.type_candle]].values ) # plt.plot(df_stock.index, df_stock["5. adjusted close"].values, lw=2) l_min = [df_stock.index[0]] l_leg = [s_ticker] - for symbol in similar: - df_similar_stock = yf.download(symbol, start=s_start, progress=False) - if not df_similar_stock.empty: - plt.plot( - df_similar_stock.index, - df_similar_stock[d_candle_types[ns_parser.type_candle]].values, - ) - l_min.append(df_similar_stock.index[0]) - l_leg.append(symbol) + + l_stocks = similar[:] + + while l_stocks: + l_parsed_stocks = list() + for symbol in l_stocks: + try: + df_similar_stock = yf.download(symbol, start=s_start, progress=False, threads=False) + if not df_similar_stock.empty: + plt.plot( + df_similar_stock.index, + df_similar_stock[d_candle_types[ns_parser.type_candle]].values, + ) + l_min.append(df_similar_stock.index[0]) + l_leg.append(symbol) + + l_parsed_stocks.append(symbol) + except Exception as e: + print("") + print(e) + print( + "Disregard previous error, which is due to API Rate limits from Yahoo Finance." + ) + print( + f"Because we like '{symbol}', and we won't leave without getting data from it." + ) + + for parsed_stock in l_parsed_stocks: + l_stocks.remove(parsed_stock) + plt.xlabel("Time") plt.ylabel("Share Price ($)") plt.legend(l_leg) From c39363da666a2d8e10b63e256a51ae78f9ee9f62 Mon Sep 17 00:00:00 2001 From: didier Date: Thu, 8 Apr 2021 22:32:54 +0100 Subject: [PATCH 06/17] Fix black --- .../comparison_analysis/ca_controller.py | 20 ++++++++++++------- .../comparison_analysis/yahoo_finance_api.py | 12 ++++++++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/gamestonk_terminal/comparison_analysis/ca_controller.py b/gamestonk_terminal/comparison_analysis/ca_controller.py index 4ed4f897364..3a41630d39d 100644 --- a/gamestonk_terminal/comparison_analysis/ca_controller.py +++ b/gamestonk_terminal/comparison_analysis/ca_controller.py @@ -74,7 +74,7 @@ class ComparisonAnalysisController: if self.similar: print(f"[{self.user}] Similar Companies: {', '.join(self.similar)}") - #else: + # else: # print(f"No similar companies [{self.user}]") print("\nComparison Analysis Mode:") @@ -117,7 +117,7 @@ class ComparisonAnalysisController: # If polygon source not selected, the user may want to get # similar companies based on Industry and Sector only, and not # on the fact that they are based on the same country - if '-p' not in other_args and '--polygon' not in other_args: + if "-p" not in other_args and "--polygon" not in other_args: parser.add_argument( "--nocountry", action="store_true", @@ -144,20 +144,26 @@ class ComparisonAnalysisController: else: if ns_parser.b_no_country: - compare_list = ['Sector', 'Industry'] + compare_list = ["Sector", "Industry"] else: - compare_list = ['Sector', 'Industry', 'Country'] + compare_list = ["Sector", "Industry", "Country"] - self.similar = Overview().compare(self.ticker, compare_list, verbose=0)['Ticker'].to_list() + self.similar = ( + Overview() + .compare(self.ticker, compare_list, verbose=0)["Ticker"] + .to_list() + ) self.user = "Finviz" if self.similar: print(f"\n[{self.user}] Similar Companies: {', '.join(self.similar)}") if len(self.similar) > 10: - print("\nThe limit of stocks to compare with are 10. Hence, the similar stocks list will be:") + print( + "\nThe limit of stocks to compare with are 10. Hence, the similar stocks list will be:" + ) self.similar = self.similar[:10] - print(', '.join(self.similar)) + print(", ".join(self.similar)) except Exception as e: print(e) diff --git a/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py b/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py index 09f4330cc50..72df9f825ad 100644 --- a/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py +++ b/gamestonk_terminal/comparison_analysis/yahoo_finance_api.py @@ -81,7 +81,9 @@ def historical(l_args, df_stock, s_ticker, s_start, s_interval, similar): plt.figure(figsize=plot_autoscale(), dpi=PLOT_DPI) plt.title(f"Similar companies to {s_ticker}") - df_stock = yf.download(s_ticker, start=s_start, progress=False, threads=False) + df_stock = yf.download( + s_ticker, start=s_start, progress=False, threads=False + ) plt.plot( df_stock.index, df_stock[d_candle_types[ns_parser.type_candle]].values ) @@ -95,11 +97,15 @@ def historical(l_args, df_stock, s_ticker, s_start, s_interval, similar): l_parsed_stocks = list() for symbol in l_stocks: try: - df_similar_stock = yf.download(symbol, start=s_start, progress=False, threads=False) + df_similar_stock = yf.download( + symbol, start=s_start, progress=False, threads=False + ) if not df_similar_stock.empty: plt.plot( df_similar_stock.index, - df_similar_stock[d_candle_types[ns_parser.type_candle]].values, + df_similar_stock[ + d_candle_types[ns_parser.type_candle] + ].values, ) l_min.append(df_similar_stock.index[0]) l_leg.append(symbol) From a4feb0642a876ad11ed034bc86e46c331ce2b0e3 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Thu, 8 Apr 2021 22:33:51 +0100 Subject: [PATCH 07/17] Update ROADMAP.md --- ROADMAP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROADMAP.md b/ROADMAP.md index 36bddcdafbf..bb5763ac666 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -108,7 +108,7 @@ * [x] Add multi-ticker historical data comparison (@didier) - [PR #141](https://github.com/DidierRLopes/GamestonkTerminal/pull/141) * [x] Add multi-ticker financials comparison (@didier) - [PR #237](https://github.com/DidierRLopes/GamestonkTerminal/pull/237) * [x] Add multi-ticker sentiment comparison (@didier) - [PR #250](https://github.com/DidierRLopes/GamestonkTerminal/pull/250) -* [x] Get similar companies from Finviz based on Industry and Sector (and possibly country) from Finviz (@didier) - [PR #321](https://github.com/DidierRLopes/GamestonkTerminal/pull/321) +* [x] Get similar companies from Finviz based on Industry and Sector (and possibly country) from Finviz (@didier) - [PR #323](https://github.com/DidierRLopes/GamestonkTerminal/pull/323) **NEXT** From dc17f1bf26a2b393dc1c48c044a8ad57445dc9ce Mon Sep 17 00:00:00 2001 From: didier Date: Thu, 8 Apr 2021 23:12:19 +0100 Subject: [PATCH 08/17] Add overview,valuation,performance,ownership,.. to comparison analysis --- .../comparison_analysis/ca_controller.py | 42 +++++++++++++++++-- gamestonk_terminal/config_terminal.py | 2 +- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/gamestonk_terminal/comparison_analysis/ca_controller.py b/gamestonk_terminal/comparison_analysis/ca_controller.py index 3a41630d39d..700d056fa1f 100644 --- a/gamestonk_terminal/comparison_analysis/ca_controller.py +++ b/gamestonk_terminal/comparison_analysis/ca_controller.py @@ -14,6 +14,7 @@ from gamestonk_terminal.helper_funcs import get_flair, parse_known_args_and_warn from gamestonk_terminal.comparison_analysis import yahoo_finance_api as yf_api from gamestonk_terminal.comparison_analysis import market_watch_api as mw_api from gamestonk_terminal.comparison_analysis import finbrain_api as f_api +from gamestonk_terminal.comparison_analysis import finviz_view from gamestonk_terminal.menu import session from prompt_toolkit.completion import NestedCompleter @@ -35,6 +36,12 @@ class ComparisonAnalysisController: "cashflow", "sentiment", "scorr", + "overview", + "valuation", + "financial", + "ownership", + "performance", + "technical", ] def __init__( @@ -82,19 +89,24 @@ class ComparisonAnalysisController: print(" q quit this menu, and shows back to main menu") print(" quit quit to abandon program") print("") - print(" get get similar companies [Polygon API]") + print(" get get similar companies") print(" select select similar companies") print("") print(" historical historical price data comparison") print(" hcorr historical price correlation") - print("") print(" income income financials comparison") print(" balance balance financials comparison") print(" cashflow cashflow comparison") - print("") print(" sentiment sentiment analysis comparison") print(" scorr sentiment correlation") print("") + print(" overview brief overview comparison") + print(" valuation brief valuation comparison") + print(" financial brief financial comparison") + print(" ownership brief ownership comparison") + print(" performance brief performance comparison") + print(" technical brief technical comparison") + print("") return @staticmethod @@ -274,6 +286,30 @@ class ComparisonAnalysisController: """Process sentiment correlation command""" f_api.sentiment_correlation(other_args, self.ticker, self.similar) + def call_overview(self, other_args: List[str]): + """Process overview command""" + finviz_view.screener(other_args, "overview", self.ticker, self.similar) + + def call_valuation(self, other_args: List[str]): + """Process valuation command""" + finviz_view.screener(other_args, "valuation", self.ticker, self.similar) + + def call_financial(self, other_args: List[str]): + """Process financial command""" + finviz_view.screener(other_args, "financial", self.ticker, self.similar) + + def call_ownership(self, other_args: List[str]): + """Process ownership command""" + finviz_view.screener(other_args, "ownership", self.ticker, self.similar) + + def call_performance(self, other_args: List[str]): + """Process performance command""" + finviz_view.screener(other_args, "performance", self.ticker, self.similar) + + def call_technical(self, other_args: List[str]): + """Process technical command""" + finviz_view.screener(other_args, "technical", self.ticker, self.similar) + def menu(stock: pd.DataFrame, ticker: str, start: datetime, interval: str): """Comparison Analysis Menu""" diff --git a/gamestonk_terminal/config_terminal.py b/gamestonk_terminal/config_terminal.py index 4189a27ce4e..813e4d64a6a 100644 --- a/gamestonk_terminal/config_terminal.py +++ b/gamestonk_terminal/config_terminal.py @@ -19,7 +19,7 @@ API_REDDIT_USER_AGENT = os.getenv("GT_API_REDDIT_USER_AGENT") or "REPLACE_ME" API_REDDIT_PASSWORD = os.getenv("GT_API_REDDIT_PASSWORD") or "REPLACE_ME" # https://polygon.io -API_POLYGON_KEY = os.getenv("GT_API_POLYGON_KEY") or "REPLACE_ME" +API_POLYGON_KEY = os.getenv("GT_API_POLYGON_KEY") or "pTx4m2fILimhK7YpR49Oa0DAec2bpnSG" # https://developer.twitter.com API_TWITTER_KEY = os.getenv("GT_API_TWITTER_KEY") or "REPLACE_ME" From 6b35403094f19e0ee064ec444b3aba3fddbd34b8 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Thu, 8 Apr 2021 23:25:51 +0100 Subject: [PATCH 09/17] Update README.md --- .../comparison_analysis/README.md | 96 ++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/gamestonk_terminal/comparison_analysis/README.md b/gamestonk_terminal/comparison_analysis/README.md index 19210c56f74..f00b902183d 100644 --- a/gamestonk_terminal/comparison_analysis/README.md +++ b/gamestonk_terminal/comparison_analysis/README.md @@ -18,8 +18,20 @@ This menu aims to compare a pre-loaded stock with similar companies, and the usa * cashflow financials comparison [Market Watch] * [sentiment](#sentiment) * sentiment analysis comparison [FinBrain] -* [scorr](#corr) +* [scorr](#scorr) * sentiment correlation between similar companies [FinBrain] +* [overview](#overview) + * brief overview (e.g. Sector, Industry, Market Cap, Volume) [Finviz] +* [valuation](#valuation) + * brief valuation (e.g. P/E, PEG, P/S, P/B, EPS this Y) [Finviz] +* [financial](#financial) + * brief financial (e.g. Dividend, ROA, ROE, ROI, Earnings) [Finviz] +* [ownership](#ownership) + * brief ownership (e.g. Float, Insider Own, Short Ratio) [Finviz] +* [performance](#performance) + * brief performance (e.g. Perf Week, Perf YTD, Volatility M) [Finviz] +* [technical](#technical) + * brief technical (e.g. Beta, SMA50, 52W Low, RSI, Change) [Finviz] ## get @@ -148,3 +160,85 @@ Sentiment correlation between similar companies [Source: FinBrain] Captura de ecrã 2021-03-20, às 15 57 01 +## overview + +```text +usage: overview [-s L_SIMILAR] [-a L_ALSO] +``` + +Prints screener data of similar companies. Some of the fields shown are: Sector, Industry, Market Cap, Volume. [Source: Finviz] + +* -s : similar companies to compare with. Default pre-loaded ones. +* -a : apart from loaded similar companies also compare with. + +overview + + +## valuation + +```text +usage: valuation [-s L_SIMILAR] [-a L_ALSO] +``` + +Prints screener data of similar companies. Some of the fields shown are: P/E, PEG, P/S, P/B, EPS this Y. [Source: Finviz] + +* -s : similar companies to compare with. Default pre-loaded ones. +* -a : apart from loaded similar companies also compare with. + +valuation + + +## financial + +```text +usage: financial [-s L_SIMILAR] [-a L_ALSO] +``` + +Prints screener data of similar companies. Some of the fields shown are: Dividend, ROA, ROE, ROI, Earnings. [Source: Finviz] + +* -s : similar companies to compare with. Default pre-loaded ones. +* -a : apart from loaded similar companies also compare with. + +financial + + +## ownership + +```text +usage: ownership [-s L_SIMILAR] [-a L_ALSO] +``` + +Prints screener data of similar companies. Some of the fields shown are: Float, Insider Own, Short Ratio. [Source: Finviz] + +* -s : similar companies to compare with. Default pre-loaded ones. +* -a : apart from loaded similar companies also compare with. + +ownership + + +## performance + +```text +usage: performance [-s L_SIMILAR] [-a L_ALSO] +``` + +Prints screener data of similar companies. Some of the fields shown are: Perf Week, Perf YTD, Volatility M. [Source: Finviz] + +* -s : similar companies to compare with. Default pre-loaded ones. +* -a : apart from loaded similar companies also compare with. + +performance + + +## technical + +```text +usage: technical [-s L_SIMILAR] [-a L_ALSO] +``` + +Prints screener data of similar companies. Some of the fields shown are: Beta, SMA50, 52W Low, RSI, Change. [Source: Finviz] + +* -s : similar companies to compare with. Default pre-loaded ones. +* -a : apart from loaded similar companies also compare with. + +technical From 24a338238e4821ddffd4d91c27ce19e939bda3f8 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Thu, 8 Apr 2021 23:27:24 +0100 Subject: [PATCH 10/17] Update README.md --- gamestonk_terminal/screener/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gamestonk_terminal/screener/README.md b/gamestonk_terminal/screener/README.md index 557e0181be1..b4f46eb644d 100644 --- a/gamestonk_terminal/screener/README.md +++ b/gamestonk_terminal/screener/README.md @@ -9,17 +9,17 @@ This menu aims to filter stocks based on pre-specified preset filters, and the u * [historical](#historical) * view historical price [Yahoo Finance] * [overview](#overview) - * overview (e.g. Sector, Industry, Market Cap, Volume) [Finviz] + * overview data (e.g. Sector, Industry, Market Cap, Volume) [Finviz] * [valuation](#valuation) - * valuation (e.g. P/E, PEG, P/S, P/B, EPS this Y) [Finviz] + * valuation data (e.g. P/E, PEG, P/S, P/B, EPS this Y) [Finviz] * [financial](#financial) - * financial (e.g. Dividend, ROA, ROE, ROI, Earnings) [Finviz] + * financial data (e.g. Dividend, ROA, ROE, ROI, Earnings) [Finviz] * [ownership](#ownership) - * ownership (e.g. Float, Insider Own, Short Ratio) [Finviz] + * ownership data (e.g. Float, Insider Own, Short Ratio) [Finviz] * [performance](#performance) - * performance (e.g. Perf Week, Perf YTD, Volatility M) [Finviz] + * performance data (e.g. Perf Week, Perf YTD, Volatility M) [Finviz] * [technical](#technical) - * technical (e.g. Beta, SMA50, 52W Low, RSI, Change) [Finviz] + * technical data (e.g. Beta, SMA50, 52W Low, RSI, Change) [Finviz] * contains [Oversold (-s) signal example](#signal-oversold) * [signals](#signals) * view filter signals (e.g. -s top_gainers) [Finviz] From b8c7f5c210cbca99d86c8c36c59a7a4bdb0b251f Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Thu, 8 Apr 2021 23:29:16 +0100 Subject: [PATCH 11/17] Update ROADMAP.md --- ROADMAP.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ROADMAP.md b/ROADMAP.md index bb5763ac666..1642af3fe10 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -109,10 +109,11 @@ * [x] Add multi-ticker financials comparison (@didier) - [PR #237](https://github.com/DidierRLopes/GamestonkTerminal/pull/237) * [x] Add multi-ticker sentiment comparison (@didier) - [PR #250](https://github.com/DidierRLopes/GamestonkTerminal/pull/250) * [x] Get similar companies from Finviz based on Industry and Sector (and possibly country) from Finviz (@didier) - [PR #323](https://github.com/DidierRLopes/GamestonkTerminal/pull/323) +* [x] Output brief screen (overview, performance, financial, valuation) across similar companies (@didier) - [PR #323](https://github.com/DidierRLopes/GamestonkTerminal/pull/323) **NEXT** -* [ ] Perform quick screening across similar companies based on key metrics (overview, performance, financial, valuation) from Finviz (@didier) + --- From ac6036d5be5638ab35c096a25aaa831604a9c764 Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 9 Apr 2021 00:26:42 +0100 Subject: [PATCH 12/17] Forgot the main file of the PR... --- .../comparison_analysis/finviz_view.py | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 gamestonk_terminal/comparison_analysis/finviz_view.py diff --git a/gamestonk_terminal/comparison_analysis/finviz_view.py b/gamestonk_terminal/comparison_analysis/finviz_view.py new file mode 100644 index 00000000000..10767e2cab9 --- /dev/null +++ b/gamestonk_terminal/comparison_analysis/finviz_view.py @@ -0,0 +1,115 @@ +""" Finviz View """ +__docformat__ = "numpy" + +import argparse +from typing import List +import os +import configparser +import pandas as pd +from finvizfinance.screener import ( + technical, + overview, + valuation, + financial, + ownership, + performance, +) +from gamestonk_terminal.helper_funcs import ( + parse_known_args_and_warn, + check_positive, +) + + +def get_comparison_data(data_type: str, similar: List[str]): + """Screener Overview + + Parameters + ---------- + data_type : str + Data type between: overview, valuation, financial, ownership, performance, technical + + Returns + ---------- + pd.DataFrame + Dataframe with overview, valuation, financial, ownership, performance or technical + """ + if data_type == "overview": + screen = overview.Overview() + elif data_type == "valuation": + screen = valuation.Valuation() + elif data_type == "financial": + screen = financial.Financial() + elif data_type == "ownership": + screen = ownership.Ownership() + elif data_type == "performance": + screen = performance.Performance() + elif data_type == "technical": + screen = technical.Technical() + else: + print("Invalid selected screener type") + return pd.DataFrame() + + screen.set_filter(ticker=",".join(similar)) + df_screen = screen.ScreenerView(verbose=0) + + return df_screen + + +def screener(other_args: List[str], data_type: str, ticker: str, similar: List[str]): + """Screener + + Parameters + ---------- + other_args : List[str] + Command line arguments to be processed with argparse + data_type : str + Data type string between: overview, valuation, financial, ownership, performance, technical + ticker : str + Main ticker to compare income + similar : List[str] + Similar companies to compare income with + """ + parser = argparse.ArgumentParser( + add_help=False, + prog=data_type, + description=""" + Prints screener data of similar companies. [Source: Finviz] + """, + ) + parser.add_argument( + "-s", + "--similar", + dest="l_similar", + type=lambda s: [str(item).upper() for item in s.split(",")], + default=similar, + help="similar companies to compare with.", + ) + parser.add_argument( + "-a", + "--also", + dest="l_also", + type=lambda s: [str(item).upper() for item in s.split(",")], + default=[], + help="apart from loaded similar companies also compare with.", + ) + + try: + ns_parser = parse_known_args_and_warn(parser, other_args) + if not ns_parser: + return + + l_similar = ns_parser.l_similar + l_similar += ns_parser.l_also + + # Add main ticker to similar list of companies + l_similar = [ticker] + l_similar + + df_screen = get_comparison_data(data_type, l_similar) + + if not df_screen.empty: + print(df_screen.to_string()) + print("") + + except Exception as e: + print(e, "\n") + return From 68769e34c44b2c6765fcdc5bd71b7530928d622c Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 9 Apr 2021 00:29:26 +0100 Subject: [PATCH 13/17] fix errors --- gamestonk_terminal/comparison_analysis/finviz_view.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/gamestonk_terminal/comparison_analysis/finviz_view.py b/gamestonk_terminal/comparison_analysis/finviz_view.py index 10767e2cab9..372d90af223 100644 --- a/gamestonk_terminal/comparison_analysis/finviz_view.py +++ b/gamestonk_terminal/comparison_analysis/finviz_view.py @@ -3,8 +3,6 @@ __docformat__ = "numpy" import argparse from typing import List -import os -import configparser import pandas as pd from finvizfinance.screener import ( technical, @@ -16,7 +14,6 @@ from finvizfinance.screener import ( ) from gamestonk_terminal.helper_funcs import ( parse_known_args_and_warn, - check_positive, ) From c2c31fb1b0d43b891ca3d4bc35ed34a79097f88f Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 9 Apr 2021 00:32:54 +0100 Subject: [PATCH 14/17] mypy doesnt like same module name even in different dirs --- .../comparison_analysis/ca_controller.py | 14 +++++++------- .../{finviz_view.py => finviz_compare_view.py} | 0 2 files changed, 7 insertions(+), 7 deletions(-) rename gamestonk_terminal/comparison_analysis/{finviz_view.py => finviz_compare_view.py} (100%) diff --git a/gamestonk_terminal/comparison_analysis/ca_controller.py b/gamestonk_terminal/comparison_analysis/ca_controller.py index 700d056fa1f..e2c48f83810 100644 --- a/gamestonk_terminal/comparison_analysis/ca_controller.py +++ b/gamestonk_terminal/comparison_analysis/ca_controller.py @@ -14,7 +14,7 @@ from gamestonk_terminal.helper_funcs import get_flair, parse_known_args_and_warn from gamestonk_terminal.comparison_analysis import yahoo_finance_api as yf_api from gamestonk_terminal.comparison_analysis import market_watch_api as mw_api from gamestonk_terminal.comparison_analysis import finbrain_api as f_api -from gamestonk_terminal.comparison_analysis import finviz_view +from gamestonk_terminal.comparison_analysis import finviz_compare_view from gamestonk_terminal.menu import session from prompt_toolkit.completion import NestedCompleter @@ -288,27 +288,27 @@ class ComparisonAnalysisController: def call_overview(self, other_args: List[str]): """Process overview command""" - finviz_view.screener(other_args, "overview", self.ticker, self.similar) + finviz_compare_view.screener(other_args, "overview", self.ticker, self.similar) def call_valuation(self, other_args: List[str]): """Process valuation command""" - finviz_view.screener(other_args, "valuation", self.ticker, self.similar) + finviz_compare_view.screener(other_args, "valuation", self.ticker, self.similar) def call_financial(self, other_args: List[str]): """Process financial command""" - finviz_view.screener(other_args, "financial", self.ticker, self.similar) + finviz_compare_view.screener(other_args, "financial", self.ticker, self.similar) def call_ownership(self, other_args: List[str]): """Process ownership command""" - finviz_view.screener(other_args, "ownership", self.ticker, self.similar) + finviz_compare_view.screener(other_args, "ownership", self.ticker, self.similar) def call_performance(self, other_args: List[str]): """Process performance command""" - finviz_view.screener(other_args, "performance", self.ticker, self.similar) + finviz_compare_view.screener(other_args, "performance", self.ticker, self.similar) def call_technical(self, other_args: List[str]): """Process technical command""" - finviz_view.screener(other_args, "technical", self.ticker, self.similar) + finviz_compare_view.screener(other_args, "technical", self.ticker, self.similar) def menu(stock: pd.DataFrame, ticker: str, start: datetime, interval: str): diff --git a/gamestonk_terminal/comparison_analysis/finviz_view.py b/gamestonk_terminal/comparison_analysis/finviz_compare_view.py similarity index 100% rename from gamestonk_terminal/comparison_analysis/finviz_view.py rename to gamestonk_terminal/comparison_analysis/finviz_compare_view.py From be55a5b208305f45d81b85b6e5354d58875cf2be Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 9 Apr 2021 00:35:09 +0100 Subject: [PATCH 15/17] cmon black, you get me everytime --- gamestonk_terminal/comparison_analysis/ca_controller.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamestonk_terminal/comparison_analysis/ca_controller.py b/gamestonk_terminal/comparison_analysis/ca_controller.py index e2c48f83810..67b91f8b4da 100644 --- a/gamestonk_terminal/comparison_analysis/ca_controller.py +++ b/gamestonk_terminal/comparison_analysis/ca_controller.py @@ -304,7 +304,9 @@ class ComparisonAnalysisController: def call_performance(self, other_args: List[str]): """Process performance command""" - finviz_compare_view.screener(other_args, "performance", self.ticker, self.similar) + finviz_compare_view.screener( + other_args, "performance", self.ticker, self.similar + ) def call_technical(self, other_args: List[str]): """Process technical command""" From 3e248a14d962614a545a7deb1da8f5cc28552cbd Mon Sep 17 00:00:00 2001 From: Artem Veremey Date: Fri, 9 Apr 2021 07:47:41 -0700 Subject: [PATCH 16/17] Revert to REPLACE_ME --- gamestonk_terminal/config_terminal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gamestonk_terminal/config_terminal.py b/gamestonk_terminal/config_terminal.py index 813e4d64a6a..4189a27ce4e 100644 --- a/gamestonk_terminal/config_terminal.py +++ b/gamestonk_terminal/config_terminal.py @@ -19,7 +19,7 @@ API_REDDIT_USER_AGENT = os.getenv("GT_API_REDDIT_USER_AGENT") or "REPLACE_ME" API_REDDIT_PASSWORD = os.getenv("GT_API_REDDIT_PASSWORD") or "REPLACE_ME" # https://polygon.io -API_POLYGON_KEY = os.getenv("GT_API_POLYGON_KEY") or "pTx4m2fILimhK7YpR49Oa0DAec2bpnSG" +API_POLYGON_KEY = os.getenv("GT_API_POLYGON_KEY") or "REPLACE_ME" # https://developer.twitter.com API_TWITTER_KEY = os.getenv("GT_API_TWITTER_KEY") or "REPLACE_ME" From 22824cad24ea4c286fce63e0b9d4a2ad5180776e Mon Sep 17 00:00:00 2001 From: Artem Veremey Date: Fri, 9 Apr 2021 07:51:14 -0700 Subject: [PATCH 17/17] New pyupgrade features --- .../fundamental_analysis/yahoo_finance_api.py | 4 ++-- gamestonk_terminal/residuals_analysis/residuals_api.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gamestonk_terminal/fundamental_analysis/yahoo_finance_api.py b/gamestonk_terminal/fundamental_analysis/yahoo_finance_api.py index 5f1c413940c..f7eef62eb8a 100644 --- a/gamestonk_terminal/fundamental_analysis/yahoo_finance_api.py +++ b/gamestonk_terminal/fundamental_analysis/yahoo_finance_api.py @@ -125,7 +125,7 @@ def shareholders(l_args, s_ticker): ].apply(lambda x: long_number_format(x)) df_institutional_shareholders["Stake"] = df_institutional_shareholders[ "Stake" - ].apply(lambda x: str("{:.2f}".format(100 * x)) + " %") + ].apply(lambda x: str(f"{100 * x:.2f}") + " %") print(df_institutional_shareholders.to_string(index=False)) print("") @@ -142,7 +142,7 @@ def shareholders(l_args, s_ticker): lambda x: long_number_format(x) ) df_mutualfund_shareholders["Stake"] = df_mutualfund_shareholders["Stake"].apply( - lambda x: str("{:.2f}".format(100 * x)) + " %" + lambda x: str(f"{100 * x:.2f}") + " %" ) print(df_mutualfund_shareholders.to_string(index=False)) diff --git a/gamestonk_terminal/residuals_analysis/residuals_api.py b/gamestonk_terminal/residuals_analysis/residuals_api.py index 97df26a3b1d..4b62ddf53c1 100644 --- a/gamestonk_terminal/residuals_analysis/residuals_api.py +++ b/gamestonk_terminal/residuals_analysis/residuals_api.py @@ -559,11 +559,11 @@ def independence( result = bds(residuals, max_dim=6) print("BDS Test") - print("Dim 2: z-static {:.4f} Prob {:.4f}".format(result[0][0], result[1][0])) - print("Dim 3: z-static {:.4f} Prob {:.4f}".format(result[0][1], result[1][1])) - print("Dim 4: z-static {:.4f} Prob {:.4f}".format(result[0][2], result[1][2])) - print("Dim 5: z-static {:.4f} Prob {:.4f}".format(result[0][3], result[1][3])) - print("Dim 6: z-static {:.4f} Prob {:.4f}".format(result[0][4], result[1][4])) + print(f"Dim 2: z-static {result[0][0]:.4f} Prob {result[1][0]:.4f}") + print(f"Dim 3: z-static {result[0][1]:.4f} Prob {result[1][1]:.4f}") + print(f"Dim 4: z-static {result[0][2]:.4f} Prob {result[1][2]:.4f}") + print(f"Dim 5: z-static {result[0][3]:.4f} Prob {result[1][3]:.4f}") + print(f"Dim 6: z-static {result[0][4]:.4f} Prob {result[1][4]:.4f}") print("")