MCPcopy
hub / github.com/CryptoSignal/Crypto-Signal / _get_informant_results

Method _get_informant_results

app/behaviour.py:172–223  ·  view source on GitHub ↗

Execute the informant analysis on a particular exchange and pair. Args: exchange (str): The exchange to get the indicator results for. market_pair (str): The pair to get the market pair results for. Returns: list: A list of dictinaries containing

(self, exchange, market_pair)

Source from the content-addressed store, hash-verified

170
171
172 def _get_informant_results(self, exchange, market_pair):
173 """Execute the informant analysis on a particular exchange and pair.
174
175 Args:
176 exchange (str): The exchange to get the indicator results for.
177 market_pair (str): The pair to get the market pair results for.
178
179 Returns:
180 list: A list of dictinaries containing the results of the analysis.
181 """
182
183 informant_dispatcher = self.strategy_analyzer.informant_dispatcher()
184 results = { informant: list() for informant in self.informant_conf.keys() }
185 historical_data_cache = dict()
186
187 for informant in self.informant_conf:
188 if informant not in informant_dispatcher:
189 self.logger.warn("No such informant %s, skipping.", informant)
190 continue
191
192 for informant_conf in self.informant_conf[informant]:
193 if informant_conf['enabled']:
194 candle_period = informant_conf['candle_period']
195 else:
196 self.logger.debug("%s is disabled, skipping.", informant)
197 continue
198
199 if candle_period not in historical_data_cache:
200 historical_data_cache[candle_period] = self._get_historical_data(
201 market_pair,
202 exchange,
203 candle_period
204 )
205
206 if historical_data_cache[candle_period]:
207 analysis_args = {
208 'historical_data': historical_data_cache[candle_period]
209 }
210
211 if 'period_count' in informant_conf:
212 analysis_args['period_count'] = informant_conf['period_count']
213
214 results[informant].append({
215 'result': self._get_analysis_result(
216 informant_dispatcher,
217 informant,
218 analysis_args,
219 market_pair
220 ),
221 'config': informant_conf
222 })
223 return results
224
225
226 def _get_crossover_results(self, new_result):

Callers 1

_test_strategiesMethod · 0.95

Calls 3

_get_historical_dataMethod · 0.95
_get_analysis_resultMethod · 0.95
informant_dispatcherMethod · 0.80

Tested by

no test coverage detected