Exemplo n.º 1
0
        public MoneyBalanceOverTime(BaseInvestmentSchedule investmentSchedule, BaseInvestmentStategy investmentStategy, List <MoneyDaily> dailyMoneyLogs)
        {
            AmountInvested         = 0;
            BaseInvestmentSchedule = investmentSchedule;
            BaseInvestmentStategy  = investmentStategy;

            StartDate = DateTime.MaxValue;
            EndDate   = DateTime.MinValue;

            DataDictionary = new Dictionary <DateTime, MoneyDaily>();
            this.Data      = dailyMoneyLogs;

            foreach (var item in dailyMoneyLogs)
            {
                AmountInvested += item.CashInvested;
                DataDictionary.Add(item.Date, item);

                if (item.Date.IsBefore(StartDate))
                {
                    StartDate = item.Date;
                }

                if (item.Date.IsAfter(EndDate))
                {
                    EndDate = item.Date;
                }
            }
        }
Exemplo n.º 2
0
        private void SelectScheduleButton_Click(object sender, EventArgs e)
        {
            SelectedSchedule = new StandardInvestmentSchedule();

            InvestmentScheduleLabel.Text = SelectedSchedule.InvestmentRulesName;
            UpdateStrategyButtonStatus();
            UpdateStartAnalysisButton();
        }
Exemplo n.º 3
0
 public BaseInvestmentStategy(string name, string desc, TimeInterval timeInterval, BaseInvestmentSchedule investmentSchedule, DateTime?startDate = null, DateTime?endDate = null)
 {
     StategyName         = name;
     StrategyDescription = desc;
     TimeInterval        = timeInterval;
     InvestmentSchedule  = investmentSchedule;
     StrategyStartDate   = startDate;
     StrategyEndDate     = endDate;
 }
Exemplo n.º 4
0
 public CrystalBallStrategy(BaseInvestmentSchedule baseInvestmentSchedule, DateTime?startDate = null, DateTime?endDate = null)
     : base(NAME, DESC, TimeInterval.Daily, baseInvestmentSchedule, startDate, endDate)
 {
     AddSellBuyDate(new DateTime(2007, 11, 8), new DateTime(2009, 3, 5));   // 2008 recession
     AddSellBuyDate(new DateTime(1999, 12, 30), new DateTime(2002, 10, 4)); // 1999- 2002 recession
     AddSellBuyDate(new DateTime(2011, 7, 19), new DateTime(2011, 10, 3));  // mini 2011 drop
     AddSellBuyDate(new DateTime(2018, 10, 4), new DateTime(2018, 12, 25)); // end of 2018 drop
     AddSellBuyDate(new DateTime(2018, 10, 4), new DateTime(2018, 12, 25)); // end of 2018 drop
     AddSellBuyDate(new DateTime(1998, 7, 27), new DateTime(2018, 10, 1));  // mini 1998 drop
     AddSellBuyDate(new DateTime(1987, 9, 1), new DateTime(1987, 10, 27));  // mini 1987 drop
 }
 public AlwaysBuyBasedOnWeekDay(BaseInvestmentSchedule baseInvestmentSchedule, DayOfWeek dayOfWeek, DateTime start, DateTime end)
     : base(GetName(dayOfWeek), GetDescription(dayOfWeek), TimeInterval.Daily, baseInvestmentSchedule, start, end)
 {
     _DayOfWeek = dayOfWeek;
 }
 public IfUpOverPeriodOfTime(BaseInvestmentSchedule schedule, DateTime start, DateTime end)
     : base(Name, Desc, TimeInterval.Daily, schedule, start, end)
 {
 }
Exemplo n.º 7
0
 public BuyAccordingToMonth(BaseInvestmentSchedule schedule, DateTime start, DateTime end)
     : base("Month", "Month buying", TimeInterval.Daily, schedule, start, end)
 {
 }
Exemplo n.º 8
0
 public NoActionStrategy(BaseInvestmentSchedule investmentSchedule, DateTime?startDate = null, DateTime?endDate = null)
     : base(NAME, DESC, TimeInterval.Yearly, investmentSchedule, startDate, endDate)
 {
 }
 public BasedOnPercentageStrategy(BaseInvestmentSchedule schedule, DateTime startDate, DateTime endDate)
     : base(Name, Desc, TimeInterval.Daily, schedule, startDate, endDate)
 {
 }
Exemplo n.º 10
0
 public AlwaysBuyStrategy(BaseInvestmentSchedule baseInvestmentSchedule, DateTime?startDate = null, DateTime?endDate = null)
     : base(NAME, DESC, TimeInterval.Daily, baseInvestmentSchedule, startDate, endDate)
 {
 }