public RateData(double bid, double ask, double high, double low, DateTime date, RateDirection direction) { this.bid = bid; this.ask = ask; this.high = high; this.low = low; this.date = date; this.direction = direction; }
public ContractPricingComponent(Money tradeVolume, Money settlementVolume, Rate customerSpotRate, Rate costSpotRate, RateDirection rateDirection, TradeDirection tradeDirection, DateRange startEndDates, bool isAmountInSettlementCurrency) { TradeVolume = tradeVolume; SettlementVolume = settlementVolume; CustomerSpotRate = customerSpotRate; CostSpotRate = costSpotRate; RateDirection = rateDirection; TradeDirection = tradeDirection; StartEndDates = startEndDates; IsAmountInSettlementCurrency = isAmountInSettlementCurrency; }
public Rate(string symbol, double bid, double ask, double high, double low, DateTime date, RateDirection direction) { this.symbol = symbol; this.data = new List<RateData>(); data.Add(new RateData(bid, ask, high, low, date, direction)); }
public void GetTrend(out int?trend, out bool flag, decimal?firstPeriodRate, decimal?secondPeriodRate, RateDirection rateDirection) { trend = null; flag = false; if (!firstPeriodRate.HasValue || !secondPeriodRate.HasValue) { return; } if (firstPeriodRate - secondPeriodRate > 0.05m) { trend = 1; } else if (secondPeriodRate - firstPeriodRate > 0.05m) { trend = -1; if (rateDirection == RateDirection.OneToZero && secondPeriodRate - firstPeriodRate > 0.1m) { flag = true; } } else { trend = 0; } }
private void GetTrendByStudent(int firstPeriodTotal, int secondPeriodTotal, decimal firstPeriodAttendance, decimal secondPeriodAttendance, RateDirection rateDirection, out int?trend, out bool flag) { flag = false; trend = null; if (firstPeriodTotal == 0 || secondPeriodTotal == 0) { return; } var firstPeriodRate = firstPeriodAttendance / firstPeriodTotal; var secondPeriodRate = secondPeriodAttendance / secondPeriodTotal; GetTrend(out trend, out flag, firstPeriodRate, secondPeriodRate, rateDirection); }
private void GetTrendByAttendance(int firstPeriodTotal, int secondPeriodTotal, int firstPeriodAttendance, int secondPeriodAttendance, RateDirection rateDirection, out int?trend, out bool flag) { flag = false; trend = null; if (firstPeriodTotal != secondPeriodTotal || firstPeriodTotal == 0 || secondPeriodTotal == 0) { return; } GetTrendByStudent(firstPeriodTotal, secondPeriodTotal, firstPeriodAttendance, secondPeriodAttendance, rateDirection, out trend, out flag); }
public AutoSpotContractPricingComponent(Money tradeVolume, Money settlementVolume, Pricing.Rate customerSpotRate, Pricing.Rate costSpotRate, RateDirection rateDirection, TradeDirection tradeDirection, DateRange startEndDates, bool isAmountInSettlementCurrency) : base(tradeVolume, settlementVolume, customerSpotRate, costSpotRate, rateDirection, tradeDirection, startEndDates, isAmountInSettlementCurrency) { }