Hello all,
I have a strategy that only trades SVXY. The algorithm strictly uses hour bars, but because it's only using hour bars, it cannot make scheduled event on the minutes of an hour. So, I made a version that got the minute data of SPY so that I can make schedules on the minute. I found that the new algorithm beat the previous one by 63,000%. Am I creating a leveraged bias or something when I mix minute and hour bars? Both versions of the strategy have the same amount of leverage, amount of trades, similar drawdowns, and similar win to loss ratio. Both trade with hour indicators and the stock that is being traded is also on hour data.
Here is the first version which only uses hour bars:
Malachi Bazar
Here is the one with minute SPY data. As you can see, the earnings are amazing and it gets in the top 9% of the community, but this cannot be real. What am I doing wrong and how do I schedule events on the minute if I am only pulling hour data?
Jared Broad
Its confusing but I think I understand whats happening =) First a few basic concepts:
- MarketOnOpen executes when the market is open
- You are requesting pre-market data (so before open ticks are setting the asset price).
- SPY opens the market at 9.30am; your SVXY is set with premarket ticks already;
- All your market on open orders get filled with premarket ticks instead of the real market hours bar.
So that combined with the fact trades are happening at different physical times due to new minute resolution is making such a drastic change in the backtests.
To fix remove premarket data which is illiquid and you won't be able too trade on really; or use minute SVXY. This brings the backtest back to 2.5M which is slightly more realistic. Generally the way to understand backtests is to look at the trades -- trade by trade. Then you can understand whats happening. Even though your market on open orders are submitted at the same time they're filling at different prices because of the weird timing / resolution setup.
I'll log this in the queue so pre-market ticks simply aren't tradable as with market orders to prevent others running into this situation.
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.
Derek Tishler
I think with Coarse especially there is a problem with at open trades for a new asset being given the previous close or something really wrong. Been trying to track the problem for months but gave up as I could not make sense of anything.
Jared Broad
Indeed mixing resolutions + illiquid assets + premarket is risky combination. We'll try make it more robust to setups like this.
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.
CloudTrader
In which scenarios can this AddEquity premarket data parameter be used? not sure when we need such data.
Malachi Bazar
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!