public void makeMockTrading(DateTime startDate , DateTime endDate) { this.DailyTrades_.Clear(); DateTime roopDate = startDate; while (roopDate <= endDate) { roopDate = roopDate.AddDays(1.0); if (!CalendarManager.isHoliday("SOUTH_KOREA",roopDate)) { DayTradeInfo dti = new DayTradeInfo() { refDate = roopDate.Date, trades = new List<TradeInfo>() }; roopDate = dti.refDate; //this.tradeFuturesGeneration(dti); if (roopDate.DayOfWeek == DayOfWeek.Friday) { this.tradeIRSGeneration(dti); } this.DailyTrades_.Add(dti); } } }
private void tradeIRSGeneration(DayTradeInfo dti) { this.TradeMaker_.TradingDate_ = dti.refDate; double irsQuantity = this.random_.Next(-10, 10); ; double irsIndex = Math.Round(0.03 + this.random_.NextDouble() / 100, 5); //dti.trades.Add(this.TradeMaker_.makeVanillaIRSTradeInfo(irsQuantity, irsIndex)); }
private void tradeFuturesGeneration(DayTradeInfo dti) { this.TradeMaker_.TradingDate_ = dti.refDate; double futuresQuantity = this.random_.Next(-10, 10); Console.WriteLine("quantity : " + futuresQuantity); double futuresIndex = Math.Round(275.2 + 4 * this.random_.NextDouble(), 5); //dti.trades.Add(this.TradeMaker_.makeKOSPI200IndexFuturesTradeInfo(futuresQuantity, futuresIndex)); //double irsQuantity = r.Next(-10, 10); ; //double irsIndex = Math.Round(0.03 + r.NextDouble() / 100 ,5); //dti.trades.Add(this.TradeMaker_.makeVanillaIRSTradeInfo(irsQuantity, irsIndex)); }