Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Live Paper Trading PNL Back to Zero Suddenly... Not Sure Why

Hi quantopian community,

just wondering if anyone using the live paper trading functionality has noticed that sometimes the cumulative PNL is zeroed the next day.

For context, I have been tracking live paper trading for a basic algo since Nov 1 and cumulative PNL has been correct over the past 2 weeks but suddenly this morning the live paper trading PNL starts at zero again.

Not sure if anyone else has noticed this. Any feedback much appreciated.

3 responses

It's hard to debug without the full information, but the best guess is that there is an underlying data problem. Are you using fetch_csv()? If your external datasource is modified or unavailable, the live trading feature can behave quite unexpectedly. When the data source is restored, the PNL will be correct again, but you'll have a saw-tooth gap in your returns and risk metrics.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Thanks Dan for the reply.

Hmmm... that is really strange because I am not using fetch_csv(). I am actually not using any external data sources only the wonderful quantopian stuff:

from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline import CustomFactor, Pipeline
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.factors import AverageDollarVolume, SimpleMovingAverage, Latest
from quantopian.pipeline.factors.morningstar import MarketCap

and the algo closes out all positions at the end of the day. But for some odd reason the PNL was reset to zero Nov 15 market open from Nov 14 market close with no overnight positions.

Even stranger is that I have 3 other algos live paper trading and PNL for those were not zeroed.

Is it possible to somehow unwittingly restart the algo paper trading? I did copy and paste the algo to modify position entry logic and launched that into live paper trading Nov 14.

Hey Dan,

I dug a little deeper into this odd behavior in paper trading PNL by running the algorithm as a back test today for the relevant dates Nov 14 to Nov 15.

It seems that live paper trading traded a different name to the algorithm back test: Nov 14 live paper trading... algorithm shorted CALA but the algorithm run as a back test for Nov 14 did not short CALA at all and went long TRXC instead.

The PNL gap discrepancy in paper trading from Nov 14 to Nov 15 seems to be due to the different names traded i.e. Nov 14 cumulative PNL reflects the short CALA position but Nov 15 PNL reflects the long TRXC position.

Nov 14 is the only day that I notice this stock discrepancy between running the algo as live paper trading versus running the algo as a back test. I will keep monitoring to see if it happens again going forward and will reach out to you if it does.