In Ninjatrader, I can define a data series class:
Definition
An IntSeries is a special type of data structure that holds a series of int values and always contains the same number of elements as bars in a chart.
#region Variables
private IntSeries myIntSeries; // Define a IntSeries variable
#endregion
// Create a IntSeries object and assign it to the variable
protected override void Initialize()
{
myIntSeries = new IntSeries(this); // "this" refers to the indicator, or strategy
// itself. This syncs the IntSeries object
// to historical data bars
}
Is there a way that I should convert this type of class for my strategy to work in QuantConnect?
Thanks,
Dan
Dan Hill
I will try that. Thanks
Dan Hill
Would that same method work for the following:
myTime = new DataSeries(this);
myTime[0] = ToJulianDate(Time[0]);
Dan Hill
Thanks for the help. I am trying to save the time of each bar in another format. I was thinking that I needed to create a class for the timeseries where I could update the value of each 1 min bar as I convert it to Julian format. I do not quite have the syntax down correct in this example.
For example:
private RollingWindow<MyTimeState> mytime;
// class to hold the current state of a time instance
public class MyTimeState
{
public readonly DateTime Time0;
public MyTimeState()
{
Time0 = Time[0];
}
}
private void OnData(TradeBars Data)
{
MyTimeState.Add(Time[0]);
}
Dan Hill
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!