def __init__(self): StrategyBase.__init__(self) self.logger = get_module_logger("macd")
# coding=utf-8 from Configurable import Configurable from backtest.order_book import OrderBook from data.order import Order import numpy as np import logging from backtest.utils.utils import get_module_logger logger = get_module_logger(__name__) logger.info("init the loger from " + __name__) class Account(Configurable): """ This is the core class in the simulator, since account is the center of my framework, it connect the market and the algorithm(which is human in general). So this class must be well designed. """ def set_to_context(self, context): pass def get_from_context(self, context): pass def __init__(self, cash, database): """ In order to simualte the T+1 market, in this class, I have added the old order and the new order variable. The new order is the order deal today, so it can not sell immediately. After every day, new order and