I wrote a pretty easy algo to test if we can paper trade ETHUSDT, sourced from Binance. However, in the paper trading status page, no data points for ETHUSDT had been received and the change in strategy equity were due to fluctuations of the USDT price.
Since it is not a backtest, I will just paste my codes as follow:
from AlgorithmImports import *
from datetime import timedelta,datetime
class STX1H(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2023,3,1)
self.SetCash("USDT",100000)
self.ETH = self.AddCrypto("ETHUSDT", Resolution.Minute, Market.Binance).Symbol
self.SetBenchmark("ETHUSDT")
def OnData(self,data):
self.Debug(data.Time)
if not data.ContainsKey("ETHUSDT"):
self.Log("Data Error")
if self.Portfolio.Invested == False:
self.MarketOrder(self.ETH, 5)
CY Liang
Benchmark here, which is ETHUSDT, is always a flat line.
Mia Alissi
Based on the information provided in the extracts, it seems like you are trying to paper trade ETHUSDT on Binance using QuantConnect. Here are a few things you might want to check:
Make sure you have set up the paper trading correctly. According to the Bitfinex documentation, you need to create a paper trading sub-account and refill the paper balance. Then, create an API key for your sub-account. Use
AccountType.Cash
in your algorithms.Check if you have correctly added the crypto asset to your algorithm. According to the Binance US Crypto Price Data and Binance Crypto Price Data documentation, you can add a crypto asset using the
AddCrypto
method. For example:SetBrokerageModel
method. For example:If you have done all these and still not receiving data points for ETHUSDT, it might be a good idea to ask for help in the QuantConnect forum.
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.
Mia Alissi
Based on the information provided in the extracts, it seems like you are trying to set ETHUSDT as the benchmark for your algorithm. However, you are observing that the benchmark is a flat line.
This could be due to a couple of reasons:
The data for ETHUSDT is not being correctly fetched or processed. Make sure you have correctly added the crypto asset to your algorithm and that the data feed you are using supports this asset.
If your algorithm only uses custom data, you might have selected the "Custom data only" data feed option. This data feed doesn't require any brokerage credentials, but only works if your algorithm doesn't subscribe to non-custom data. Your algorithm crashes if it attempts to subscribe to non-custom data with this data feed in place, including the benchmark security. To avoid data issues with the benchmark security, either set the benchmark to the subscribed custom data or a constant. Here is how you can set the benchmark to a constant:
If you have done all these and the benchmark is still a flat line, it might be a good idea to ask for help in the QuantConnect forum.
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.
CY Liang
An update for ppls encountering similar issue: 1) do not include setBrokerageModel in your algo when running paper trading 2) do not include specific brokerage name when adding data to your symbols (eg. Market.Binance) 3) was able to paper trade crypto but not cryptofuture
Really appreciate if someone could provide insights on how to paper trade cryptofuture!!!
Mia Alissi
Based on the information provided in the extracts, it seems like you are trying to paper trade Crypto Futures. Here are a few things you might want to check:
AddCryptoFuture
method. For example:SetBrokerageModel
method. For example:If you have done all these and still not receiving data points for your Crypto Futures asset, it might be a good idea to ask for help in the QuantConnect forum.
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.
CY Liang
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!