Skip to content

Commit

Permalink
Refactor portfolio state sampling and storing
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Molinero committed Jan 29, 2024
1 parent 999af70 commit fbabfb7
Show file tree
Hide file tree
Showing 20 changed files with 315 additions and 504 deletions.
120 changes: 0 additions & 120 deletions Algorithm.Framework/Alphas/AlphaStreamAlphaModule.cs

This file was deleted.

4 changes: 3 additions & 1 deletion Common/ChartJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
writer.WritePropertyName("Series");
writer.WriteStartObject();
// we sort the series in ascending count so that they are chart nicely, has value for stacked area series so they're continuous
foreach (var kvp in chart.Series.OrderBy(x => x.Value.Values.Count).ThenBy(x => x.Value.Values.Select(x => (x as ChartPoint)?.Y ?? 0).Sum()))
foreach (var kvp in chart.Series.OrderBy(x => x.Value.Index)
.ThenBy(x => x.Value.Values.Count)
.ThenBy(x => x.Value.Values.Select(x => (x as ChartPoint)?.Y ?? 0).Sum()))
{
writer.WritePropertyName(kvp.Key);
serializer.Serialize(writer, kvp.Value);
Expand Down
2 changes: 0 additions & 2 deletions Common/Data/BaseData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using QuantConnect.Util;
using QuantConnect.Data.Market;
using System.Collections.Generic;
using QuantConnect.Data.Custom;

namespace QuantConnect.Data
{
Expand All @@ -36,7 +35,6 @@ namespace QuantConnect.Data
[ProtoInclude(200, typeof(QuoteBar))]
[ProtoInclude(300, typeof(Dividend))]
[ProtoInclude(400, typeof(Split))]
[ProtoInclude(555, typeof(PortfolioState))]
public abstract class BaseData : IBaseData
{
private decimal _value;
Expand Down
239 changes: 0 additions & 239 deletions Common/Data/Custom/PortfolioState.cs

This file was deleted.

Loading

0 comments on commit fbabfb7

Please sign in to comment.