Example #1
0
    def __init__(self, ttype, tid, balance, time):
        Trader.__init__(self, ttype, tid, balance, time)
        self.prev_orders = []
        self.active = False
        self.limit = None
        self.job = None

        #memory of all bids and asks and accepted bids and asks
        self.outstanding_bids = []
        self.outstanding_asks = []
        self.accepted_asks = []
        self.accepted_bids = []

        self.price = -1

        # memory of best price & quantity of best bid and ask, on LOB on previous update
        self.prev_best_bid_p = None
        self.prev_best_bid_q = None
        self.prev_best_ask_p = None
        self.prev_best_ask_q = None

        self.first_turn = True

        self.gamma = 0.1

        self.holdings = 10
        self.remaining_offer_ops = 10
        self.values = [[0 for n in range(self.remaining_offer_ops)]
                       for m in range(self.holdings)]
    def __init__(self, ttype, tid, balance, time):

        Trader.__init__(self, ttype, tid, balance, time)

        self.limit = None
        self.job = None

        # variable for MLOFI
        self.last_lob = None
        self.list_OFI = []
        self.list_D = []
    def __init__(self, ttype, tid, balance, time, m):

        Trader.__init__(self, ttype, tid, balance, time)

        self.limit = None
        self.job = None

        # variable for MLOFI
        self.last_lob = None
        self.es_list = []
        self.ds_list = []

        #variable
        self.m = m
Example #4
0
    def __init__(self, ttype, tid, balance, time,m):

        Trader.__init__(self, ttype, tid, balance, time)

        self.limit = None
        self.job = None

        # learning variables
        self.r_shout_change_relative = 0.05
        self.r_shout_change_absolute = 0.05
        self.short_term_learning_rate = random.uniform(0.1, 0.5)
        self.long_term_learning_rate = random.uniform(0.1, 0.5)
        self.moving_average_weight_decay = 0.95  # how fast weight decays with time, lower is quicker, 0.9 in vytelingum
        self.moving_average_window_size = 5
        self.offer_change_rate = 3.0
        self.theta = -2.0
        self.theta_max = 2.0
        self.theta_min = -8.0
        self.marketMax = bse_sys_maxprice

        # Variables to describe the market
        self.previous_transactions = []
        self.moving_average_weights = []
        for i in range(self.moving_average_window_size):
            self.moving_average_weights.append(self.moving_average_weight_decay ** i)
        self.estimated_equilibrium = []
        self.smiths_alpha = []
        self.prev_best_bid_p = None
        self.prev_best_bid_q = None
        self.prev_best_ask_p = None
        self.prev_best_ask_q = None

        # Trading Variables
        self.r_shout = None
        self.buy_target = None
        self.sell_target = None
        self.buy_r = -1.0 * (0.3 * random.random())
        self.sell_r = -1.0 * (0.3 * random.random())

        # variable for MLOFI
        self.last_lob = None;
        self.es_list = [];
        self.ds_list = [];

        #variable for ratio
        self.bids_volume_list = []
        self.asks_volume_list = []

        # m
        self.m = m;
Example #5
0
    def __init__(self, ttype, tid, balance, time,m):
        Trader.__init__(self, ttype, tid, balance, time)
        self.limit = None
        self.job = None

        # variable for MLOFI
        self.last_lob = None;
        self.es_list = [];
        self.ds_list = [];

        #variable for ratio
        self.bids_volume_list = []
        self.asks_volume_list = []

        # m
        self.m = m;
Example #6
0
        def __init__(self, ttype, tid, balance, time,m):
                Trader.__init__(self, ttype, tid, balance, time)
                self.active = False
                self.limit = None
                self.job = None

                #memory of all bids and asks and accepted bids and asks
                self.outstanding_bids = []
                self.outstanding_asks = []
                self.accepted_asks = []
                self.accepted_bids = []

                self.price = -1

                # memory of best price & quantity of best bid and ask, on LOB on previous update
                self.prev_best_bid_p = None
                self.prev_best_bid_q = None
                self.prev_best_ask_p = None
                self.prev_best_ask_q = None

                self.first_turn = True

                self.gamma = 0.1

                self.holdings = 10
                self.remaining_offer_ops = 10
                self.values = [[0 for n in range(self.remaining_offer_ops)] for m in range(self.holdings)]

                # variable for MLOFI
                self.last_lob = None;
                self.es_list = [];
                self.ds_list = [];

                # variable for ratio
                self.bids_volume_list = []
                self.asks_volume_list = []

                # variable
                self.m = m;
Example #7
0
    def __init__(self, ttype, tid, balance, time, m):
        Trader.__init__(self, ttype, tid, balance, time)
        m_fix = 0.05
        m_var = 0.05
        self.job = None  # this is 'Bid' or 'Ask' depending on customer order
        self.active = False  # gets switched to True while actively working an order
        self.prev_change = 0  # this was called last_d in Cliff'97
        self.beta = 0.1 + 0.2 * random.random()  # learning rate
        self.momntm = 0.3 * random.random()  # momentum
        self.ca = 0.10  # self.ca & .cr were hard-coded in '97 but parameterised later
        self.cr = 0.10
        self.margin = None  # this was called profit in Cliff'97
        self.margin_buy = -1.0 * (m_fix + m_var * random.random())
        self.margin_sell = m_fix + m_var * random.random()
        self.price = None
        self.limit = None
        # memory of best price & quantity of best bid and ask, on LOB on previous update
        self.prev_best_bid_p = None
        self.prev_best_bid_q = None
        self.prev_best_ask_p = None
        self.prev_best_ask_q = None
        # memory of worst prices from customer orders received so far
        self.worst_bidprice = None
        self.worst_askprice = None

        # variable for MLOFI
        self.last_lob = None
        self.es_list = []
        self.ds_list = []

        #variable for ratio
        self.bids_volume_list = []
        self.asks_volume_list = []

        #variable
        self.m = m