Skip to content

Commit

Permalink
few minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
robcarver17 committed Jan 27, 2021
1 parent cd68197 commit 666a84e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions sysdata/mongodb/mongo_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ def get_list_of_keys(self)->list:

return key_list

def get_list_of_values_for_dict_key(self, dict_key):
key_list = self.get_list_of_keys()
list_of_results = [self.get_result_dict_for_key(key) for key in key_list]
list_of_values = [item_dict.get(dict_key, None) for item_dict in list_of_results]

return list_of_values

def get_result_dict_for_key(self, key) ->dict:
key_name = self.key_name
Expand Down
2 changes: 1 addition & 1 deletion sysdata/mongodb/mongo_historic_orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def get_list_of_order_ids_for_strategy_and_contract(


def get_list_of_strategies(self):
list_of_keys = self.mongo_data.get_list_of_keys()
list_of_keys = self.mongo_data.get_list_of_values_for_dict_key("key")
list_of_contract_strategies = [futuresContractStrategy.from_key(key) for key in list_of_keys]
list_of_strategies = [futures_contract_strategy.strategy_name for futures_contract_strategy in list_of_contract_strategies]

Expand Down

0 comments on commit 666a84e

Please sign in to comment.