# Path: alephnull/test_algorithms.py
# class TestAlgorithm(TradingAlgorithm):
#     """
#     This algorithm will send a specified number of orders, to allow unit tests
#     to verify the orders sent/received, transactions created, and positions
#     at the close of a simulation.
#     """
# 
#     def initialize(self, sid, amount, order_count, sid_filter=None):
#         self.count = order_count
#         self.sid = sid
#         self.amount = amount
#         self.incr = 0
# 
#         if sid_filter:
#             self.sid_filter = sid_filter
#         else:
#             self.sid_filter = [self.sid]
# 
#     def handle_data(self, data):
#         # place an order for 100 shares of sid
#         if self.incr < self.count:
#             self.order(self.sid, self.amount)
#             self.incr += 1


import alephnull.utils.factory as factory
from alephnull.test_algorithms import TestAlgorithm
    sid_list = config.get('sid_list')
    if not sid_list:
        sid = config.get('sid')
        sid_list = [sid]

    concurrent_trades = config.get('concurrent_trades', False)

    if 'order_count' in config:
        order_count = config['order_count']
    else:
        order_count = 100

    if 'order_amount' in config:
        order_amount = config['order_amount']
    else:
        order_amount = 100

    if 'trade_count' in config:
        trade_count = config['trade_count']
    else:
        # to ensure all orders are filled, we provide one more
        # trade than order
        trade_count = 101

    #-------------------
    # Create the Algo
    #-------------------
    if 'algorithm' in config:
        test_algo = config['algorithm']
    else:

# Path: alephnull/test_algorithms.py
# class TestAlgorithm(TradingAlgorithm):
#     """
#     This algorithm will send a specified number of orders, to allow unit tests
#     to verify the orders sent/received, transactions created, and positions
#     at the close of a simulation.
#     """
# 
#     def initialize(self, sid, amount, order_count, sid_filter=None):
#         self.count = order_count
#         self.sid = sid
#         self.amount = amount
#         self.incr = 0
# 
#         if sid_filter:
#             self.sid_filter = sid_filter
#         else:
#             self.sid_filter = [self.sid]
# 
#     def handle_data(self, data):
#         # place an order for 100 shares of sid
#         if self.incr < self.count:
#             self.order(self.sid, self.amount)
#             self.incr += 1


# Path: alephnull/utils/simfactory.py
import alephnull.utils.factory as factory
from alephnull.test_algorithms import TestAlgorithm

    sid_list = config.get('sid_list')
    if not sid_list:
        sid = config.get('sid')
        sid_list = [sid]

    concurrent_trades = config.get('concurrent_trades', False)

    if 'order_count' in config:
        order_count = config['order_count']
    else:
        order_count = 100

    if 'order_amount' in config:
        order_amount = config['order_amount']
    else:
        order_amount = 100

    if 'trade_count' in config:
        trade_count = config['trade_count']
    else:
        # to ensure all orders are filled, we provide one more
        # trade than order
        trade_count = 101

    #-------------------
    # Create the Algo
    #-------------------
    if 'algorithm' in config:
        test_algo = config['algorithm']
    else:

        test_algo = TestAlgorithm(