forked from pst-group/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepocsv_spotfx_prices.py
More file actions
executable file
·29 lines (22 loc) · 921 Bytes
/
repocsv_spotfx_prices.py
File metadata and controls
executable file
·29 lines (22 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
Get FX prices from csv repo files and write to arctic
WARNING WILL OVERWRITE EXISTING!
"""
from sysdata.csv.csv_spot_fx import csvFxPricesData
from sysproduction.data.currency_data import dataCurrency
if __name__ == "__main__":
input("Will overwrite existing prices are you sure?! CTL-C to abort")
dataCurrency = dataCurrency()
csv_fx_prices = csvFxPricesData()
db_fx_price_data = dataCurrency.db_fx_prices_data
currency_code = input("Currency code? <return for ALL currencies> ")
if currency_code == "":
list_of_ccy_codes = csv_fx_prices.get_list_of_fxcodes()
else:
list_of_ccy_codes = [currency_code]
for currency_code in list_of_ccy_codes:
fx_prices = csv_fx_prices.get_fx_prices(currency_code)
print(fx_prices)
db_fx_price_data.add_fx_prices(
code=currency_code, fx_price_data=fx_prices, ignore_duplication=True
)