Mariner Backtesting - OverflowError

  • An overflow error is an error that happens when a program receives a number, value, or variable outside the scope of its ability to handle.
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 712, in process_event
    event.context._call_on_timer(event)
  File "/opt/anaconda/lib/python2.7/site-packages/tradesim/context.py", line 465, in _call_on_timer
    self.strategy.on_timer(event, self.market, self.order, self.service, self.account)
  File "job/CQ8363b02d97e6431a987e28934767f1af.py", line 2200, in on_timer
    self.ARCAOpen( md, order, service, account,event.timestamp)
  File "job/CQ8363b02d97e6431a987e28934767f1af.py", line 2158, in ARCAOpen
    lQty = abs(int( lBetaTickPos/md.stat.prev_close))
OverflowError: cannot convert float infinity to integer
Sample Broken Code
 int(float('inf'))
Notes
  • This is a standard python error. If you try and convert a float value like infinity or -infinity to an integer you will trigger it