'Write all ticks to the database'

def save_to_database(self):

    self.database.delete_all_ticks()
    for order_id in self.get_order_ids():
        tick = self.get_tick(order_id)
        if tick.is_valid():
            self.database.add_tick(tick.tick)
