LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
All I want to do is test a simple strategy where I short 10k of VXX every month forever, from 2009 until now. I tried doing this on Quantopian, but their VXX data is hosed because they don't handle the 2018 transistion to VXXB. It looks like the QuantConnect data is good though.
However, my code gives this runtime error - Backtest Handled Error: VXX: asset price is $0. If using custom data make sure you've set the 'Value' property.
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.
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.
that suggested using the "permtick" "vxx.1", which filled in my early data holes.
How would I look up a "permtick" in the future? Is this a term of art?
0
Derek Melchin
STAFF
,
Hi John,
The $0 error occurs when placing trades for a security that doesn't currently have pricing data. We can ensure we don't run into this error by checking if the CurrentSlice has data for VXX in our scheduled function.
if (CurrentSlice.ContainsKey(vxx)) {
var shares = -100;
MarketOrder(vxx, shares);
Log("Sold " + shares + " of VXX on " + Time);
}
Additionally, when scheduling a function to trade 10 minutes after the open, we need to ensure we have a bar that closed 10 minutes after the open. Daily resolution will cause the algorithm to submit orders with stale prices. This happens because the 10 minutes of trading time between the close of the last daily bar and the current moment hasn't reached our algorithm yet. If we use minute resolution instead, the algorithm will have the bar which closed 10 minutes after the open. To solidify this concept, I recommend reviewing the attached backtest and our documentation on understanding time.
In regards to the permticks, VXX is a particular case that can only be addressed by knowledge of the VXX history (see related discussion). For symbol lookup, we advise using our Data Explorer.
Best, Derek
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.
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...
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!