HELP: How to track individual securities in Portfolio?

Back

Hello all, I have a question.

Hi, suppose I have AAPL, MSFT, GE stock in my Universe.

At any point in time, I may have AAPL, MSFT, GE invested. My algorithm will constantly look for opportunities to invest in AAPL, MSFT, GE, regardless of whether or not I have already invested prior.

i) Suppose I wanted to only invest AAPL, MSFT, GE if and only if a week has passed since I last invested them, what would be a good way to track the number of days that have passed? Likewise, suppose I wanted to liquidate each security after 5 days?

Thank you!

Update Backtest







 
0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


In the same vein, I understand that we can look at each security in our portfolio and figure out the net profit/loss. Is there anyway for me to look at each trade in our portfolio and figure out the profit/loss on a per trade basis?

0

Please check out Boot Camp Oscar! It'll get you started =)
0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Jared, which one are your referencing, as I've completed most of the bootcamps. I understand most of them revolves around checking for the securities and the state for each securities. Is there anyway to track the state of each trade instead? For example, I see in the bootcamp that we can invest if SPY hasn't been invested yet, or liquidate if SPY has done something and so on so forth, but I don't see the lesson that teaches us how to manage each order of the SPY if we are in more than one.

For example, suppose I make 3 SPY trades over the course of 3 days, I want to monitor each trade such that if any of them individually loses 1%, I will liquidate that position without affection the rest of them.

Thank you!

0

I coded up something to do this for options about a month ago. Trades can be defined in many ways but I defined them as a full round trip closure of the initial opening. You just need to use imagination and can do practically anything within the framework.

1

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed