Hello,
I don't understand why the the win rate doesn't become the loss rate when I switch from ticker TQQQ to SQQQ. Shouldn't these two be opposites of each other? If TQQQ is up 1% from 11am-3:59pm on a day, doesn't that mean that SQQQ is down roughly 1% from 11am-3:59pm on that day? The fees also seem to be significantly lower on the SQQQ example even though it places the same exact number of trades as the TQQQ example?
Thanks!
Sean
Derek Melchin
Hi Sean,
The win rate of the algorithm trading TQQQ is very similar to the win rate of the algorithm trading SQQQ because the algorithm is essentially placing the same trades in both cases. With the current parameters, the algorithm compares the price at 11 AM to the closing price of the previous day. If the price at 11 AM is less than the previous close, the algorithm takes a long position in the security. Otherwise, the algorithm takes a short position in the security.
TQQQ and SQQQ have opposite daily returns. Therefore, if the algorithm takes a long position in TQQQ on day x, it takes a short position in SQQQ on day x. Since the securities have opposite daily returns and the algorithm places opposite trades for each security, the win rate of the algorithm doesn't change much when we change TQQQ for SQQQ.
The fees are lower for SQQQ because the share price of SQQQ is higher than the share price of TQQQ, so the algorithm buys fewer shares of SQQQ. The algorithm is using the default fee model, which charges $0.005/share. The algorithm can buy more TQQQ shares per trade, so it ends up costing more fees to trade.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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.
S O'Keeffe
Hi Derek,
Thanks so much! I don't know why I couldn't wrap my head around those two points. Thank you for making those clear and easy for me now.
So maybe there is no way to have the loss rate become the win rate on this attached example? Can you think of a way? I thought going long vs going short on the same security would have opposite results. When I use Short for the “GreaterThanOpen” parameter in the attached example, I see a 40% win rate. When I switch the “GreaterThanOpen” parameter to be Long instead of Short, I see a 45% win rate.
Thanks!
Sean
Derek Melchin
Hi Sean,
In this algorithm, flipping the rules would mean changing each -1 to 1 and changing each 1 to -1 while keeping the security constant. However, if we flip a strategy's rules so that it places the trades in the opposite direction, the win rate doesn't become the loss rate because of commissions and spread fees.
Best,
Derek Melchin
Want to invest in QuantConnect as we build the Linux of quant finance? Checkout our Wefunder campaign to join the revolution.
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.
S O'Keeffe
Hi Derek,
OK thank you! So the difference between going long and going short will have that few cent difference between the bid and the ask? That makes sense. And then the win rate only counts a trade as a win if the trade is positive after commissions are taken into account?
Thanks!
Sean
Derek Melchin
Hi Sean,
Yes, to view our definition of win rate, see the glossary.
Best,
Derek Melchin
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.
S O'Keeffe
Ah ok perfect thank you again Derek!
S O'Keeffe
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!