AddUniverse(coarse =>
{
return (from cf in coarse
where cf.Price > minPrice
where cf.Volume > minVolume
// orderby cf.Price descending
orderby cf.Volume descending
select cf.Symbol).Take(15);
});
Using the above statement I onyl want to add stocks to the Portfolio. But it looks as is futures are added as well. Backtests showed that symbol VXX was added and when buying it my portfolio cash decreased dramatically as I treated in as as stock.
How can I detect futures or avoid adding futures to the list?
Jared Broad
The add universe is only equities; its likely https://finance.yahoo.com/quote/VXX?p=VXX
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.
Ulrich
Thank you Jared
After bying the VXX for 6000 $ the cash is reduced from 50.000$ to 235 $. How can this be? And further orders cannot be executed. My intention is to buy in maximum 5 stocks and use for each stock 6.000 $ thus having 20.000 $ as a reserve.
2014-08-21 00:00:00 Buy x-> 8/21/2014 VXX U9R0H3K6HVMT hSMA=460.04 iRSI=27.61824 orderSize=13 price=443.36000000000
2014-08-21 00:00:00 Converted OrderID: 1 into a MarketOnOpen order.
2014-08-21 00:00:00 Submitted stop loss @ 8/21/2014 410.688
2014-08-21 00:00:00 Trace x-> 8/21/2014 Cash=50000.0 XLF RGRPZX100F39 hSMA=17.34219 iRSI=72.04969 orderSize=0 price=17.49574821700
2014-08-21 00:00:00 Trace x-> 8/21/2014 Cash=50000.0 XLI RGRPZX100F39 hSMA=49.88005 iRSI=81.14558 orderSize=0 price=50.80360498500
2014-08-21 00:00:00 BUY -> 8/21/2014 VXX U9R0H3K6HVMT 443.36000000000
2014-08-21 00:00:00 Submitted stop loss @ 8/21/2014 410.688
2014-08-22 00:00:00 new--> Added: 8/22/2014 TRV R735QTJ8XC9X
...
2014-08-22 00:00:00 SPY,INTC R735QTJ8XC9X,JCP R735QTJ8XC9X,XLI RGRPZX100F39,VXX U9R0H3K6HVMT,HTZ ...
2014-08-22 00:00:00 Trace x-> 8/22/2014 Cash=235.160 SPY hSMA=184.71112 iRSI=73.14662 orderSize=0 price=186.71396520000
----------------------------------------------------------
Programm Code is rather messy right now because it is more a playing field for writing first systems in C#.
Ulrich
Here is a short code snippet just bying VXX and showing Portfolio.Cash. After bying VXX stocks for 6000 $ the Portfolio.Cash value equals to -23474.570. How can a negative value be? What means Portfolio.Cash?
Jared Broad
Thanks we'll look into it and get back to you.
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.
Ulrich
Am 25. November 2017 06:23:01 MEZ schrieb QuantConnect Community
Ulrich
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!