Back to Community
Paper Trading Positions suddenly emptied

Hi,

I am testing a algo in paper trading. It was working fine from last Friday (08/04/2017) till yesterday (Wed, 08/09/2017). Then today I opened the algo paper trading page (around 9am), then there was no position showing on the dashboard. I am 100% sure that the previous trading date has all the correct positions and there is no way that all the positions can by liquidated all of sudden.

I was wondering why it is happening. Is it because of context.portfolio.positions was not passed or maintained properly?

Is it an issue just for paper trading or is it likely to happen in living trading as well (but I am assuming quantopian algo will take actual data from the IB account to update the context object, right?)?

Thanks a lot!

2 responses

Bump for answers.

Update:
It seems that it has something to do fetch_csv. I think if I can appending the CSV, i.e. keeping all the historical data rows, it will work fine. For example,

on 8/1/2017:
symbol,date,value
AAPL,8/1/2017,1

on 8/2/2017:
symbol,date,value
AAPL,8/1/2017,1
AAPL,8/2/2017,2

In this case, I think the algo will act normally. But if I only keep the most current data, for example:
on 8/1/2017:
symbol,date,value
AAPL,8/1/2017,1

on 8/2/2017:
symbol,date,value
AAPL,8/2/2017,2

It probably would give errors.

I think it needs improvement. What if the algo only uses most current data, and does not care about any historical data. Keeping appending the CSV file seems not the best option, especially if one plans to trade for a longer time.

And also, I am still not sure if this only happens in Paper trading or it is the same in Living trading as well.

Thanks for any help!

Bump for answers... Thanks...