Esempio n. 1
0
        public BidAskEvent(Product product, char bidAsk, int date, int time, int millSec = 0, int priceDepth = 1)
            : base(product, date, time, millSec)
        {
            this.bidAsk = bidAsk;
            if (priceDepth == 0)
                return;

            if (bidAsk == BidAsk.BID || bidAsk == BidAsk.BOTH)
                bids = new PriceQty[priceDepth];
            if (bidAsk == BidAsk.ASK || bidAsk == BidAsk.BOTH)
                asks = new PriceQty[priceDepth];
        }
Esempio n. 2
0
        public BidAskEvent(Product product, char bidAsk, int date, int time, int millSec, float queuePrice, int queueQty)
            : base(product, date, time, millSec)
        {
            this.bidAsk = bidAsk;

            PriceQty[] arr = new PriceQty[1];
            arr[0] = new PriceQty(queuePrice, queueQty);

            if (bidAsk == BidAsk.BID)
                bids = arr;
            if (bidAsk == BidAsk.ASK || bidAsk == BidAsk.BOTH)
                asks = arr;
        }
Esempio n. 3
0
 public TradeEvent(Product product, int date, int time, float tradeQty, float tradePrice, short tradeType)
     : base(product, date, time)
 {
     this.tradePrice = tradePrice;
     this.tradeQty = tradeQty;
     this.tradeType = tradeType;
 }
Esempio n. 4
0
 public ProductEvent(Product product, int date, int time, int millSec)
     : base(date, time, millSec)
 {
     this.product = product;
 }
Esempio n. 5
0
 public ProductEvent(Product product, int date, int time)
     : base(date, time)
 {
     this.product = product;
 }
Esempio n. 6
0
 public static float calcNextPrice(Product prod, float price, bool isUp)
 {
     if (prod is DevProduct){
         DevProduct dProd = prod as DevProduct;
         if (dProd.series.FileSuffix == "01"){
             if(dProd.CLASS_CODE == "VHS")
                 return isUp ? (price + 0.05F) : (price - 0.05F);
             else
                 return isUp ? price + 1 : price - 1;
         }
         else if (dProd.series.FileSuffix == "02")
             return isUp ? (price + 0.01F) : (price - 0.01F);
         else
             return isUp ? price + 1 : price - 1;
     }
     else
         return (float)calPriceFromSpreadTable(price, isUp);
 }
Esempio n. 7
0
 public double getPnL(Product product)
 {
     if (product is DevProduct)
     {
         DevProduct devProduct = (DevProduct)product;
         return devProduct.MULTIPLIER * (sumShort - sumLong + (product.CurrentPrice - beginPrice) * beginPosition + (longQty - shortQty) * product.CurrentPrice);
     }
     else
         return (sumShort - sumLong + (product.CurrentPrice - beginPrice) * beginPosition + (longQty - shortQty) * product.CurrentPrice);
 }