Mariner Backtesting - SyntaxError

  • An invalid syntax error means that there is a line of code that python does not know what to do with.
Sample Traceback
 Traceback (most recent call last):
  File "run_simulation.py", line 550, in <module>
    main(sys.argv[1:])
  File "run_simulation.py", line 435, in main
    cls = extract_strategy_class(src_file)
  File "run_simulation.py", line 66, in extract_strategy_class
    execfile(filename, global_dict)
  File "job/CQ8f16682d028a4d638d2d312ea7be9afb.py", line 112
    for str not in [self.symbol]:
              ^
SyntaxError: invalid syntax
Sample Broken Code
 print 2 + apple
Sample Fixed Code
 apple = 5
print 2 + apple
Notes
  • Something you wrote is not understood by python.