public string Generate(CalculatedPositionInfo position)
        {
            var builder = new StringBuilder();

            builder.AppendLine("Local Time,Volume");

            if (position.HasPositions)
            {
                var values = position.Positions.Select(p => $"{p.Timestamp},{p.Trade.Volume}");
                var value  = string.Join(Environment.NewLine, values);

                builder.Append(value);
            }

            return(builder.ToString());
        }
Пример #2
0
        public async Task <Result <ReportOutcome> > ReportAsync(CalculatedPositionInfo position)
        {
            var report = this.generator.Generate(position);

            return(await this.saver.SaveAsync(report, position.Date));
        }