Contains all the methods required for analyzing strategies.
| 13 | from analyzers import * |
| 14 | |
| 15 | class StrategyAnalyzer(): |
| 16 | """Contains all the methods required for analyzing strategies. |
| 17 | """ |
| 18 | |
| 19 | def __init__(self): |
| 20 | """Initializes StrategyAnalyzer class """ |
| 21 | self.logger = structlog.get_logger() |
| 22 | |
| 23 | |
| 24 | def indicator_dispatcher(self): |
| 25 | """Returns a dictionary for dynamic anaylsis selector |
| 26 | |
| 27 | Returns: |
| 28 | dictionary: A dictionary of functions to serve as a dynamic analysis selector. |
| 29 | """ |
| 30 | |
| 31 | dispatcher = { |
| 32 | 'ichimoku': ichimoku.Ichimoku().analyze, |
| 33 | 'macd': macd.MACD().analyze, |
| 34 | 'rsi': rsi.RSI().analyze, |
| 35 | 'momentum': momentum.Momentum().analyze, |
| 36 | 'mfi': mfi.MFI().analyze, |
| 37 | 'stoch_rsi': stoch_rsi.StochasticRSI().analyze, |
| 38 | 'obv': obv.OBV().analyze |
| 39 | } |
| 40 | |
| 41 | return dispatcher |
| 42 | |
| 43 | |
| 44 | def informant_dispatcher(self): |
| 45 | """Returns a dictionary for dynamic informant selector |
| 46 | |
| 47 | Returns: |
| 48 | dictionary: A dictionary of functions to serve as a dynamic informant selector. |
| 49 | """ |
| 50 | |
| 51 | dispatcher = { |
| 52 | 'sma': sma.SMA().analyze, |
| 53 | 'ema': ema.EMA().analyze, |
| 54 | 'vwap': vwap.VWAP().analyze, |
| 55 | 'bollinger_bands': bollinger_bands.Bollinger().analyze, |
| 56 | 'ohlcv': ohlcv.OHLCV().analyze |
| 57 | } |
| 58 | |
| 59 | return dispatcher |
| 60 | |
| 61 | |
| 62 | def crossover_dispatcher(self): |
| 63 | """Returns a pandas.DataFrame for dynamic crossover selector |
| 64 | |
| 65 | Returns: |
| 66 | dictionary: A dictionary of functions to serve as a dynamic crossover selector. |
| 67 | """ |
| 68 | |
| 69 | dispatcher = { |
| 70 | 'std_crossover': crossover.CrossOver().analyze |
| 71 | } |
| 72 |