First off, welcome to Quantopian!
Would it be possible to attach your algo (ie an algo backtest) to your post? That will make it much clearer to debug.
However, this can be problematic if you can't even get a backtest to run. Sort of a 'Catch-22'.
One workaround for this is to 'comment out' your entire code. Put 3 single or double quotes at the very top and very bottom of your code. This will turn it all into a comment (ensure your code doesn't include triple quotes anywhere or this won't work). Then, at the very end put an empty initialize
function. This is the single function required to generate a backtest. Run the backtest (it won't do anything) and attach it to your post. That will allow others to more easily see your code and potentially help debug it.
Comment out and add the initialize
function something like this
# Put triple single or double quotes at the very top of your code
'''
this is where you code is....
'''
# Put triple single or double quotes at the very bottom of your code
# Your entire code should now appear in red as a comment
# Now add the two lines below
def initialize(context):
pass
Try that. With the code attached to a post others can more easily help debug. Good luck.
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.