Skip to content

Commit

Permalink
new batch of instruments for import
Browse files Browse the repository at this point in the history
  • Loading branch information
bug-or-feature committed Nov 24, 2024
1 parent 5203576 commit 9b4202e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 24 deletions.
50 changes: 29 additions & 21 deletions sysinit/futures/adjustedprices_from_db_multiple_to_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,30 +71,38 @@ def process_adjusted_prices_single_instrument(


if __name__ == "__main__":
input("Will overwrite existing prices are you sure?! CTL-C to abort")
instrument_code = get_valid_instrument_code_from_user(
all_code=ALL_INSTRUMENTS, allow_all=True
)
# input("Will overwrite existing prices are you sure?! CTL-C to abort")
# instrument_code = get_valid_instrument_code_from_user(
# all_code=ALL_INSTRUMENTS, allow_all=True
# )
#
# if instrument_code == ALL_INSTRUMENTS:
# # modify flags and datapath as required
# process_adjusted_prices_all_instruments(
# ADD_TO_DB=True, ADD_TO_CSV=False, csv_adj_data_path=arg_not_supplied
# )
# else:
# # modify flags and datapath as required
# process_adjusted_prices_single_instrument(
# instrument_code,
# ADD_TO_DB=True,
# ADD_TO_CSV=False,
# csv_adj_data_path=arg_not_supplied,
# )

if instrument_code == ALL_INSTRUMENTS:
# modify flags and datapath as required
process_adjusted_prices_all_instruments(
ADD_TO_DB=True, ADD_TO_CSV=False, csv_adj_data_path=arg_not_supplied
)
else:
# modify flags and datapath as required
for instr in [
"BOVESPA",
"MILLWHEAT",
"RAPESEED",
"RUBBER",
"R1000",
"SGD_mini",
"TOPIX",
]:
print(f"Starting adjusted for {instr}")
process_adjusted_prices_single_instrument(
instrument_code,
instr,
ADD_TO_DB=True,
ADD_TO_CSV=False,
csv_adj_data_path=arg_not_supplied,
)

# for instr in ["XXX"]:
# print(f"Starting adjusted for {instr}")
# process_adjusted_prices_single_instrument(
# instr,
# ADD_TO_DB=True,
# ADD_TO_CSV=False,
# csv_adj_data_path=arg_not_supplied,
# )
11 changes: 10 additions & 1 deletion sysinit/futures/contract_prices_from_split_freq_csv_to_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,16 @@ def write_prices_for_contract_at_frequency(
)
# init_db_with_split_freq_csv_prices(datapath)

for instr in ["XXX"]:
# ['BOVESPA', ''EU-DIV50', 'EU-INSURE', 'MILLWHEAT', 'RAPESEED', 'RUBBER', 'R1000', 'SGD_mini', 'TOPIX']
for instr in [
"BOVESPA",
"MILLWHEAT",
"RAPESEED",
"RUBBER",
"R1000",
"SGD_mini",
"TOPIX",
]:
init_db_with_split_freq_csv_prices_for_code(
instr, datapath, csv_config=BARCHART_CONFIG
)
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def add_phantom_row(


if __name__ == "__main__":
input("Will overwrite existing prices are you sure?! CTL-C to abort")
# input("Will overwrite existing prices are you sure?! CTL-C to abort")
# change if you want to write elsewhere
csv_multiple_data_path = arg_not_supplied

Expand All @@ -203,7 +203,15 @@ def add_phantom_row(
# csv_roll_data_path=csv_roll_data_path,
# )

for instr in ["XXX"]:
for instr in [
"BOVESPA",
"MILLWHEAT",
"RAPESEED",
"RUBBER",
"R1000",
"SGD_mini",
"TOPIX",
]:
print(f"Starting multiple for {instr}")
process_multiple_prices_single_instrument(
instrument_code=instr,
Expand Down

0 comments on commit 9b4202e

Please sign in to comment.