Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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));
 }
Ejemplo n.º 4
0
 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;
     }
 }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        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)
 {
 }