mhallsmoore / qsforex

QuantStart Forex Backtesting and Live Trading
http://www.quantstart.com
763 stars 352 forks source link

BadStatusLine issue in execution.py #22

Open mhallsmoore opened 9 years ago

mhallsmoore commented 9 years ago

Exception in thread Thread-1:

Traceback (most recent call last):

File "C:\Python27\lib\threading.py", line 810, in

__bootstrap_inner

self.run()


File "C:\Python27\lib\threading.py", line 763, in run

self.target(_self.__args, *_self.kwargs)

File "trading.py", line 40, in trade

execution.execute_order(event)

File "c:\documents\qsforex\execution\execution.py", line 71, in

execute_order

response = self.conn.getresponse().read()

File "C:\Python27\lib\httplib.py", line 1132, in getresponse

response.begin()

File "C:\Python27\lib\httplib.py", line 453, in begin

version, status, reason = self._read_status()

File "C:\Python27\lib\httplib.py", line 417, in _read_status

raise BadStatusLine(line)

BadStatusLine: ''

Some people have experienced this bug when holding positions for a long time (20 mins+). Investigate!

ryanlake10288 commented 8 years ago

Only seen this so far on the practice server. Has this been experienced on real/production?

mac4281 commented 8 years ago

I had this issue in production as well. The solution was posted on quantstart.com as a comment on one of the articles. I'll see if I can find it and post it..

ghost commented 8 years ago

The solution should be: self.conn.close()

posted as comment by simon in this article: Forex-Trading-Diary-6-Multi-Day-Trading-and-Plotting-Results