I've been struggling to begin to use the system. Can someone provide some assistance on the below code/possibly provide debugging techniques for the QyantConnect IDE?
namespace QuantConnect.Algorithm.CSharp
{
public class VentralTransdimensionalAntennaArray : QCAlgorithm
{
private AverageDirectionalIndex _adx = null;
private readonly Symbol _btc = QuantConnect.Symbol.Create("BTCUSD", SecurityType.Crypto, Market.GDAX);
public override void Initialize()
{
AddCrypto(this._btc, Resolution.Minute, Market.GDAX);
SetStartDate(2019, 4, 1); //Set Start Date
SetCash("USD", 100000, 1); //Set Strategy Cash
this._adx = ADX(this._btc, 14, Resolution.Minute);
}
/// OnData event is the primary entry point for your algorithm. Each new data point will be pumped in here.
/// Slice object keyed by symbol containing the stock data
public override void OnData(Slice data)
{
// if (!Portfolio.Invested)
// {
// SetHoldings(_spy, 1);
Debug("Purchased Stock");
Log(this._adx.ToDetailedString());
Log(this._adx.PositiveDirectionalIndex.ToString());
//}
}
}
}
Link Liang
Hi Derek,
Welcome to QuantConnect! I see that you are trying to use ADX indicator with our helper method. According to documentation, the indicators use closing price by default. In case of crypto data which uses quotebar, it actually uses mid-price of the bid closing price and the ask closing price. However, ADX requires a bar as input according to source code. That is the reason why your ADX is not updated correctly and remains 0.0.
Moreover, our GDAX data is missing since 2019-04-13. We are working closely with our data vendor to resolve this issue. Meanwhile, you could use data prior this date for backtests.
I've also put a warm-up statement to make the indicator ready to use at the beginning. Hope it helps!
Derek Barrera
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!