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 0a90ab8 commit 325770e
Show file tree
Hide file tree
Showing 22 changed files with 373 additions and 509 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
24 changes: 24 additions & 0 deletions Common/Data/Custom/AlphaStreams/PlaceHolder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

using System;

namespace QuantConnect.Data.Custom.AlphaStreams
{
[Obsolete("'QuantConnect.Data.Custom.Alphas' namespace is obsolete")]
public static class PlaceHolder
{
}
}
Loading

0 comments on commit 325770e

Please sign in to comment.