Skip to content

Using timeseries grouping inside the timeseries index #12641

Answered by aviv86
Azizollahi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi
Something like this, maybe ?

private class TimeSeries_Index : AbstractTimeSeriesIndexCreationTask<Entity, TimeSeries_Index.Result>
{
	public class Result
	{
		public DateTime Time { get; set; }

		public double Open { get; set; }

		public double Close { get; set; }

		public double High { get; set; }

		public double Low { get; set; }

	}

	public TimeSeries_Index()
	{
		AddMap("TradePrice", segments =>
			from segment in segments
			from entry in segment.Entries
			select new
			{
				Time = entry.Timestamp,
				Open = entry.Values[0],
				Close = entry.Values[1],
				High = entry.Values[2],
				Low = entry.Values[3],
			});
		Reduce = results =>
			from r in results
			group r by ne…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@Azizollahi
Comment options

@ayende
Comment options

Answer selected by ayende
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants