Пример #1
0
    plt.legend(**kwargs)
    plt.savefig(path)
    plt.clf()
    plt.cla()
    plt.close()


if __name__ == '__main__':

    import sys
    import logging
    from libCommon import ENVIRONMENT
    from libFinance import STOCK_TIMESERIES, HELPER as FINANCE
    from libSharpe import HELPER as MONTECARLO

    env = ENVIRONMENT()

    log_msg = '%(module)s.%(funcName)s(%(lineno)s) %(levelname)s - %(message)s'
    logging.basicConfig(stream=sys.stdout, format=log_msg, level=logging.DEBUG)

    file_list = env.list_filenames('local/historical_prices/*pkl')
    ini_list = env.list_filenames('local/*.ini')

    portfolio_ini = filter(lambda ini: "portfolio" in ini, ini_list)
    portfolio_ini = filter(lambda ini: "sharpe" in ini, ini_list)
    logging.debug(portfolio_ini)

    def prep(tickers):
        reader = STOCK_TIMESERIES.init()
        values = map(lambda ticker: reader.extract_from_yahoo(ticker), tickers)
        values = map(lambda data: pd.DataFrame(data)['Adj Close'], values)
Пример #2
0
def main():
    env = ENVIRONMENT()
    logging.info(env)
    file_list = env.list_filenames(extension='local/*.ini')
    logging.info(file_list)