Test the strategies and perform notifications as required Args: market_data (dict): A dictionary containing the market data of the symbols to analyze. output_mode (str): Which console output mode to use.
(self, market_data, output_mode)
| 66 | |
| 67 | |
| 68 | def _test_strategies(self, market_data, output_mode): |
| 69 | """Test the strategies and perform notifications as required |
| 70 | |
| 71 | Args: |
| 72 | market_data (dict): A dictionary containing the market data of the symbols to analyze. |
| 73 | output_mode (str): Which console output mode to use. |
| 74 | """ |
| 75 | |
| 76 | new_result = dict() |
| 77 | for exchange in market_data: |
| 78 | self.logger.info("Beginning analysis of %s", exchange) |
| 79 | if exchange not in new_result: |
| 80 | new_result[exchange] = dict() |
| 81 | |
| 82 | for market_pair in market_data[exchange]: |
| 83 | self.logger.info("Beginning analysis of %s", market_pair) |
| 84 | if market_pair not in new_result[exchange]: |
| 85 | new_result[exchange][market_pair] = dict() |
| 86 | |
| 87 | new_result[exchange][market_pair]['indicators'] = self._get_indicator_results( |
| 88 | exchange, |
| 89 | market_pair |
| 90 | ) |
| 91 | |
| 92 | new_result[exchange][market_pair]['informants'] = self._get_informant_results( |
| 93 | exchange, |
| 94 | market_pair |
| 95 | ) |
| 96 | |
| 97 | new_result[exchange][market_pair]['crossovers'] = self._get_crossover_results( |
| 98 | new_result[exchange][market_pair] |
| 99 | ) |
| 100 | |
| 101 | if output_mode in self.output: |
| 102 | output_data = deepcopy(new_result[exchange][market_pair]) |
| 103 | print( |
| 104 | self.output[output_mode](output_data, market_pair), |
| 105 | end='' |
| 106 | ) |
| 107 | else: |
| 108 | self.logger.warn() |
| 109 | |
| 110 | # Print an empty line when complete |
| 111 | print() |
| 112 | return new_result |
| 113 | |
| 114 | |
| 115 | def _get_indicator_results(self, exchange, market_pair): |
no test coverage detected