Looking for an example of following.
Base series is intraday i.e. 5M, 10M etc...
Looking for a way to take current series and current symbol and compress into higher timeframe i.e. current day, currentweek, previous week, current week.
I do not want to manually add a dataseries to the chart, I want to do this from within the code.
In addition to the above, once I have this series is it possible to feed it into an function e.g. Moving Average, Swing High, etc...
How can I do this? Is this possible.
Useful example of referencing higher timeseries Data
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Useful example of referencing higher timeseries Data
Hello davewolfs,
You can load a custom data series with IDataLoader. In order to have your study calculated on this data you will need to write your own code for calculation on IDataLoader data.
Here is where to find IDataLoader interface example.
You can load a custom data series with IDataLoader. In order to have your study calculated on this data you will need to write your own code for calculation on IDataLoader data.
Here is where to find IDataLoader interface example.
Re: Useful example of referencing higher timeseries Data
A few more questions.
Is DataLoader.BeginLoadData() non blocking/asynchronous (it appears that it is). I find this odd, because you force the user to have to sleep, this doesn't seem clean.
There are two properties, Data1 and Data2 what is the difference?
Data1 is of Type Bar[]. How can I convert an array of Bar to an ISeries? If not, than how can I compute a moving average on a Bar Array?
Is DataLoader.BeginLoadData() non blocking/asynchronous (it appears that it is). I find this odd, because you force the user to have to sleep, this doesn't seem clean.
There are two properties, Data1 and Data2 what is the difference?
Data1 is of Type Bar[]. How can I convert an array of Bar to an ISeries? If not, than how can I compute a moving average on a Bar Array?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Useful example of referencing higher timeseries Data
1 - For regular barsThere are two properties, Data1 and Data2 what is the difference?
2 - For Volume Delta resolutions
At the moment you need to write your own code to do that.Data1 is of Type Bar[]. How can I convert an array of Bar to an ISeries? If not, than how can I compute a moving average on a Bar Array?
We are going to improve the IDataLoader interface in the future versions to make it easier for use.
Re: Useful example of referencing higher timeseries Data
What classes implement the ISeries interface? Can you please provide an example of initializing a collection of objects which implement this interface.
I see that variable series and object both do. But these classes are designed such that when assigning value you are giving the value of the current bar. I don't see anything that can take a number of bars and initialize with these values.
The Indexer is overload for the ISeries object, but it clearly specifies that it is read only. Aside form this I don't see a way to do this.
Please advise.
I see that variable series and object both do. But these classes are designed such that when assigning value you are giving the value of the current bar. I don't see anything that can take a number of bars and initialize with these values.
The Indexer is overload for the ISeries object, but it clearly specifies that it is read only. Aside form this I don't see a way to do this.
Please advise.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Useful example of referencing higher timeseries Data
There is no such class at the moment. You need to write your own code to do that or wait for the IDataLoader interface improvement.
Re: Useful example of referencing higher timeseries Data
Not tested.
But the way to go from Array to ISeries is through the undocumented Lamdba class.
The Lamda class is basically an ISeries class wrapper around your own data type.
It requires an anonymous lamdba function which is given the bar index being requested and what the value is mapped to.
So for example.
This is how one would run through a bar series of highs through a moving averages.
Not that we can use anything in the anonymous function.
So if we loaded a weekly timeframe, we could use this in place here.
But the way to go from Array to ISeries is through the undocumented Lamdba class.
The Lamda class is basically an ISeries class wrapper around your own data type.
It requires an anonymous lamdba function which is given the bar index being requested and what the value is mapped to.
So for example.
Code: Select all
private AverageFC m_averagefc1;
m_averagefc1.price = new Lambda<double>(barIndex =>Bars.High[barIndex]);
Not that we can use anything in the anonymous function.
So if we loaded a weekly timeframe, we could use this in place here.