Back to Community
Quantopian Copy and Paste Bug

Is anyone else having a problem where if they copy code from the new backtest menu and then paste back in to the algorithm work space, they get random spaces right at the beginning of empty lines causing syntax errors?

It's really beginning to annoy me, especially on larger codes where I have to go through 20 - 30 lines of spaces causing syntax errors before I can even begin work on the algorithm.

I am on Chrome:
Version 67.0.3396.99 (Official Build) (64-bit)

6 responses

Yes, I have gotten those as well. I have fallen back to using the copy utility from the /old version that works without any issues.

Sorry for the inconvenience! There was a known extra-indentation issue on Firefox, which we fixed, but I'm not able to reproduce that same issue on Chrome - I'm also on Version 67.0.3396.99 (Official Build) (64-bit), using OS X.

Are there any particular add-ons that you guys are using on Chrome? I can try to install them and see if the bug shows up then.


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.


# New backtest bug  
def initialize(context):  

def before_trading_start(context, data):  
    stocks = symbols('SPY', 'QQQ')  
    n = len( stocks)  
    record(n = n)

After copying this simple code from Activity -> Code and pasting in IDE

I got:

 4  Error   SyntaxError: invalid syntax  

Chrome Version 67.0.3396.99 (Official Build) (64-bit)

If you will fix the code and run it for 2 years you may get this:

2 of 2  
Structural Constraints Met  
5 of 7  
Risk Constraints Met  
0.00 %  
Total Returns  

Is not this another BIG bug?

I've only got Adblock and Norton installed. I'm getting this bug as well.

@Vladimir That's the same bug we're talking about here.

@Abhi, I have sent you an email with a video capture attachment that illustrates the copy bug and includes details of my windows 10 and Google Chrome versions. Hope that helps.

I get the similar problems, with Firefox and Chrome. It completely stops my research. How can it be solved?
Many lines are completely missing when I do copy and paste from activity/code to the ide. The problems can persist for days, even after restarting the browsers.