Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
What does it mean exactly when an asset is "restricted" according to data.can.trade()?

Hi, this is my first post in the community. I just ran into a situation where data.can.trade() returned False for a security with ticker RDFN, which ipo'd in July. I don't understand why it shows up as restricted and when I looked for the definition of what is restricted and why, I was unsuccessful in finding this information. I'd appreciate a link to somewhere that describes the what and why of restriction - hopefully including why leveraged ETF's are discussed/included in regards to this.

Thanks

4 responses

p.s. I am a relative novice trader, so I realize that this may be a "stupid question" - so, I'd appreciate it if you let me know that, and why.

Hi Dale,

data.can_trade simply checks if the given security is listed during the current date in the simulation and if it has a last known price. For example, RDFN was listed on 2017-07-27, so before that date data.can_trade would return False. You can find the documentation for this function in our help page here.

It also checks if the given security has been restricted. You can specify securities to restrict, or avoid trading, by using set_asset_restrictions. For example, trading leveraged ETFs makes it difficult to keep track of your portfolio's leverage, so you can use set_asset_restrictionsto avoid trading them. You can find more information on how to set restrictions here.

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.

Thank you for the response Ernesto.

So just to make sure that I'm understanding correctly: A security is either available to trade according to the SEC, which would mean that data.can_trade() will always return true if that is the case for a given security on a given date. Otherwise, the only other reason that data.can_trade() will return False is because you've personally declared it as such via set_asset_restrictions? Will IPO's appear as True to data.can_trade() on the opening date of the IPO?

I thought I noticed that RDFN was returning False from data.can_trade() for 07/28 or a later date during testing, but I may have been mistaken.

Thanks again.

Just to be clear, these questions are in no way meant to be any sort of criticism or jab towards Quantopian. As a retired career programmer, I am very grateful to have such a platform as Quantopian upon which to trade. It is fantastic. I'm only trying to clarify for myself the details of how things actually work.