using System;
using System.IO;
using System.Threading.Tasks;
using System.Runtime.Serialization.Formatters.Binary;
using MarketData.Utils;

namespace MarketData.Generator.Momentum
{
  public class MGSessionParams
  {
    public DateTime LastUpdated { get; set; }
    public DateTime TradeDate { get; set; }
    public DateTime StartDate { get; set; }
    public DateTime AnalysisDate { get; set; }
    public MGConfiguration Configuration { get; set; }
    public ActivePositions ActivePositions { get; set; }
    public Positions AllPositions { get; set; }
    public double CashBalance { get; set; }
    public double NonTradeableCash { get; set; }
    public int Cycle { get; set; }

// This gets AllPositions+Positions
    public Positions GetCombinedPositions()
    {
      Positions positions=new Positions();
      foreach(Position position in AllPositions) positions.Add(position);
      Positions activePositions=ActivePositions.GetPositions();
      foreach(Position position in activePositions) positions.Add(position);
      return positions;
    }
  }
}
