summaryrefslogtreecommitdiff
path: root/product/messages/CurrentStockPrice.cs
blob: d17b663dead0003a3e7d11620d9b097063da6e2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Text;
using gorilla.utility;
using solidware.financials.infrastructure.eventing;

namespace solidware.financials.messages
{
    public class CurrentStockPrice : ValueType<CurrentStockPrice>, Event
    {
        public string Symbol { get; set; }
        public decimal Price { get; set; }

        public string Change { get; set; }
        public string ChangePercentage { get; set; }
        public decimal Open { get; set; }
        public decimal High { get; set; }
        public decimal Low { get; set; }

        public override string ToString()
        {
            var builder = new StringBuilder();
            builder.AppendLine("{0} {1:C} {2} / {3}%".format(Symbol,Price,Change, ChangePercentage));
            builder.AppendLine("O:{0:C} H:{1:C} L:{2:C}".format(Open, High, Low));
            return builder.ToString();
        }
    }
}