Mariner Backtesting - Tradesim.Util.PolicyError

Tradesim.Util.PolicyLimitError Sample Traceback
 Traceback (most recent call last):
  File "run_simulation.py", line 550, in <module>
    main(sys.argv[1:])
  File "run_simulation.py", line 525, in main
    results = simulator()
  File "/opt/anaconda/lib/python2.7/site-packages/tradesim/engine.py", line 542, in __call__
    return self.simulate()
  File "/opt/anaconda/lib/python2.7/site-packages/tradesim/engine.py", line 661, in simulate
    context_collection.process_event(event, delivery_timestamp)
  File "/opt/anaconda/lib/python2.7/site-packages/tradesim/context.py", line 729, in process_event
    event.method(event.context, *event.args, **event.kwargs)
  File "/opt/anaconda/lib/python2.7/site-packages/tradesim/context.py", line 350, in on_reject
    raise PolicyLimitError("Maximum number of rejected orders ({}) reached".format(self.policy_limits['max_on_reject']))
tradesim.util.PolicyLimitError: Maximum number of rejected orders (1000) reached
Sample Fixed Code
 on_reject(self, event, md, order, account, service):
    print event
Notes
  • After 1000 rejects your strategy will fail. We recommend using on_reject method to see the reason for your reject