Hi guys,
I am new to quantconnect. I want to make the following strategy to trade on Bybit Perpetual Futures:
1. I want to create a universe on daily resolution, get all the perpetual futures contract data, and then use a universe filter to filter out the coins I want to trade based on their relative volume.
2. then I will use indicators like MACD, EMA, etc. to trade on a minute/hour resolution on the selected coins.
First, I am trying to achieve step 1 but I can only find the option to add universe for coins and not their perpetual future contracts. Does QuantConnect not give that data? If not, how can I use pybit library to use my bybit account to get that data from bybit myself?
Mia Alissi
'Shiven', you are on the right track. QuantConnect does provide data for Crypto Perpetual Futures. You can add them to your universe and apply filters based on their volume.
In your code, you are trying to add a universe of Crypto Perpetual Futures using the
CryptoCoarseFundamentalUniverse
function. However, this function is used for adding a universe of Cryptocurrencies, not their Perpetual Futures contracts.To add a Perpetual Future, you can use the
AddCryptoFuture
function as shown in the Bybit Crypto Future Margin Rate Data documentation. Here is an example:As for the universe filter, you can use the
CryptoUniverse.bybit
function as shown in the Bybit Crypto Price Data documentation. Here is an example:For the second part of your strategy, you can use the
SymbolData
class to add and update indicators like MACD, EMA, etc. for each security in your universe. You can refer to the Universe Selection EPS forum discussion for an example of how to do this.Please note that you will need to handle the data for these indicators in the
OnData
method and implement your trading logic based on the indicator values.I hope this helps! Let me know if you have any other questions.
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.
Shiven Garg
Since I want to add the universe of crypto perpetual futures and also filter them based on the perpetual futures data, does that mean I have to use AddCryptoFuture to create an array and add them manually?
Because
will load to the cryptocurrencies and not their futures. so do I have to do it like this:
Mia Alissi
'Shiven', you are correct. The
add_universe(CryptoUniverse.bybit(self.universe_selection_filter))
function will add a universe of Cryptocurrencies, not their Perpetual Futures contracts.Your approach to manually add each Perpetual Future contract using
AddCryptoFuture
is a valid workaround. Here's how you can do it:```python
Array to store crypto futuresself.crypto_futures = []
List of all symbolssymbols = ["AAVEUSDT", "ACEUSDT", "ACHUSDT", "ADAUSDT", "AERGOUSDT", "AEVOUSDT", "AGIUSDT", "AGIXUSDT", "AGLDUSDT", "AIDOGEUSDT", "AIUSDT", "AKROUSDT", "ALGOUSDT", "ALICEUSDT", "ALPACAUSDT", "ALPHAUSDT", "ALTUSDT", "AMBUSDT", "ANKRUSDT", "ANTUSDT", "APEUSDT", "API3USDT", "APTUSDT", "ARBUSDT", "ARKMUSDT", "ARKUSDT", "ARPAUSDT", "ARUSDT", "ASTRUSDT", "ATAUSDT", "ATOMUSDT", "AUCTIONUSDT", "AUDIOUSDT", "AVAXUSDT", "AXLUSDT", "AXSUSDT", "BADGERUSDT", "BAKEUSDT", "BALUSDT", "BANDUSDT", "BATUSDT", "BCHUSDT", "BEAMUSDT", "BELUSDT", "BICOUSDT", "BIGTIMEUSDT", "BLURUSDT", "BLZUSDT", "BNBUSDT", "BNTUSDT", "BNXUSDT", "BOBAUSDT", "BOMEUSDT", "BONDUSDT", "BONKUSDT", "BSVUSDT", "BSWUSDT", "BTCUSDT", "BTTUSDT", "BUSDUSDT", "C98USDT", "CAKEUSDT", "CEEKUSDT", "CELOUSDT", "CELRUSDT", "CETUSUSDT", "CFXUSDT", "CHRUSDT", "CHZUSDT", "CKBUSDT", "COMBOUSDT", "COMPUSDT", "COQUSDT", "COREUSDT", "COTIUSDT", "COVALUSDT", "CROUSDT", "CRVUSDT", "CTCUSDT", "CTKUSDT", "CTSIUSDT", "CVCUSDT", "CVXUSDT", "CYBERUSDT", "DAOUSDT", "DARUSDT", "DASHUSDT", "DATAUSDT", "DEGENUSDT", "DENTUSDT", "DGBUSDT", "DODOUSDT", "DOGEUSDT", "DOTUSD", "DOTUSDT", "DUSKUSDT", "DYDXUSDT", "DYMUSDT", "EDUUSDT", "EGLDUSDT", "ENAUSDT", "ENJUSDT", "ENSUSDT", "EOSUSDT", "ETCUSDT", "ETHFIUSDT", "ETHUSDT", "ETHWUSDT","FETUSDT", "FILUSDT", "FITFIUSDT", "FLMUSDT", "FLOKIUSDT", "FLOWUSDT", "FLRUSDT", "FORTHUSDT", "FO
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.
Shiven Garg
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!