jamsix / ib-edavki

Skripta, ki prevede XML poročilo trgovalnih poslov v platformi InteractiveBrokers v XML format primeren za uvoz v obrazce Doh-KDVP, D-IFI, Doh-Div in Doh-Obr v eDavkih Finančne uprave.
MIT License
183 stars 59 forks source link

Warn about missing entries in companies.xml #76

Closed mfilej closed 1 year ago

mfilej commented 1 year ago

Kako običajno dodajate manjkajoče vnose v companies.xml? Jaz sem do lani šel po napakah javljenih na edavkih. Lani sem se poslužil tega malega popravka. Letos mi je prišel spet prav, tako da sem se odločil predlagati to spremembo.

Primer izpisa s to spremembo:

There is no exchange rate for 20190501, using 20190430
There is no exchange rate for 20190501, using 20190430
There is no exchange rate for 20201011, using 20201009
There is no exchange rate for 20201011, using 20201009
There is no exchange rate for 20201011, using 20201009
There is no exchange rate for 20220418, using 20220414
There is no exchange rate for 20220418, using 20220414
There is no exchange rate for 20201011, using 20201009
There is no exchange rate for 20220418, using 20220414
There is no exchange rate for 20190422, using 20190418
There is no exchange rate for 20220418, using 20220414
There is no exchange rate for 20220418, using 20220414
There is no exchange rate for 20220515, using 20220513
There is no exchange rate for 20220821, using 20220819
There is no exchange rate for 20220403, using 20220401
There is no exchange rate for 20220821, using 20220819
Doh-KDVP.xml created (includes trades from years 2017, 2018, 2019, 2020, 2021, 2022)
D-IFI.xml created (includes no trades)
Missing companies.xml entry for FRES
Missing companies.xml entry for MO
Missing companies.xml entry for TTE
Missing companies.xml entry for FCX
Missing companies.xml entry for FCX
Missing companies.xml entry for XOM
Missing companies.xml entry for AEM
Missing companies.xml entry for GOLD
Missing companies.xml entry for NEM
Missing companies.xml entry for TTE
Missing companies.xml entry for RIO
Missing companies.xml entry for RIO
Missing companies.xml entry for MO
Missing companies.xml entry for FCX
Missing companies.xml entry for XOM
Missing companies.xml entry for AEM
Missing companies.xml entry for GOLD
Missing companies.xml entry for NEM
Missing companies.xml entry for BTG
Missing companies.xml entry for MO
Missing companies.xml entry for TTE
Missing companies.xml entry for FCX
Missing companies.xml entry for XOM
Missing companies.xml entry for AEM
Missing companies.xml entry for GOLD
Missing companies.xml entry for NEM
Missing companies.xml entry for RIO
Missing companies.xml entry for MO
Missing companies.xml entry for TTE
Missing companies.xml entry for FCX
Missing companies.xml entry for XOM
Missing companies.xml entry for AEM
Missing companies.xml entry for GOLD
Missing companies.xml entry for KGC
Missing companies.xml entry for TTE
Missing companies.xml entry for NEM
SAN 20220510;202000 dividend of 33.3 has been reversed, removing.
SAN 20220510;202000 dividend of 33.31 has been reversed, removing.
SHELL.DIV 20220919;202000 dividend of 25.24 has been reversed, removing.
Doh-Div.xml created
Doh-Obr.xml created

Simboli se podvajajo ... je to preveč šuma? Bi tole potrebovalo opcijski parameter?

jamsix commented 1 year ago

Definitivno uporabno! Ne bi kompliciral z opcijsko, ker je to uporabna informacija, ki jo verjetno vsak želi imet na koncu. Bi bilo pa res smiselno vsaj odstranit duplikate, če že ne spravit vse v eno vrstico. Nekaj v stilu missingCompanies = set() in potem if len(missingCompanies) > 0: print Se ti da nahekat?

mfilej commented 1 year ago

@jamsix Nahekal :) Prosim, dobro preveri, saj nisem vajen pythona. Primer izpisa pri meni:

...
There is no exchange rate for 20220821, using 20220819
Doh-KDVP.xml created (includes trades from years 2017, 2018, 2019, 2020, 2021, 2022)
D-IFI.xml created (includes no trades)
companies.xml is missing the following symbols (conids): 2386 (128356142), HOC (41957241), 215 (59754535), NOVN (1615110), 883 (12150119), BN (29612111), BMWd (14094), MBGd (29622935), SHELL.RT (562595593), 941 (3408229), TFA (30314159), 659 (42446165), PBR (10828168), J91U (117901244), 857 (46636681), CS (29612141), SHELL.RTS (544925226), BVN (1715014), FTCO (462304864), STAN (909271), ITUB (58996617), BP (5171), PAAS (4816190), BHP (4986), F34 (47990698), PAAS (14893065), GSK (909054), INN1d (240601748), 5JS (92214835), EWP (2586596), AUY (26985516), EWI (253190540), EWL (2586589), BATS (908931), AG (41855679), TKC (12816), ZURN (262834), RGLD (4817403), GORO (40743577), SHELL.DIV (578803986), SAN (12442), A7RU (96736993), FNV (69238858), WDS (70578542), BBD (28213000), BMA (38551985), SAN (29612249), K2LU (117901235), ORA (29612252), K2LU.OLD (117901235), 315 (4116485), Z74 (43626350), REPe (30314140), BTCS (508626121), SLHN (4865977), XES (413951493), OR (156955487), IGO (42469783), SBSW (404364696), MAR (9358), GSK (574757089), 23 (1616510), NCM (11289568), SCMN (3985158), SREN (88414907), 101 (1616393), AU (4656), PBBd (199971960), O2Dd (119890783), HL (8027), AOI (45743607), SHELL.DVO (596695682), VIE (29612206), CEY (99690164), TEFDe (565113874), IMB (2117419) - more info: https://github.com/jamsix/ib-edavki#dodatni-podatki-o-podjetju-za-obrazec-doh-div-opcijsko
SAN 20220510;202000 dividend of 33.3 has been reversed, removing.
SAN 20220510;202000 dividend of 33.31 has been reversed, removing.
SHELL.DIV 20220919;202000 dividend of 25.24 has been reversed, removing.
Doh-Div.xml created
Doh-Obr.xml created

Že razmišljam, da bi kot naslednji korak naredil, da mi program izpiše template (XML s predizpolnjenim symbol in conid), ki ga potem lahko copy-pastam v companies.xml in napolnim s podatki. Tole bi bilo potem preveč za stdout, tako da bi bilo verjetno primerno, da se zapiše v datoteko? missing_companies.xml ali kaj podobnega?

jamsix commented 1 year ago

Super rešitev!

Za vnaprej, mogoče je najboljša rešitev, da se manjkajoče družbe doda kar v companies.xml in se uporabnika pozove, da izpolni manjkajoče podatke.