Esempio n. 1
0
        private void BestTick(PriceStruct price, out List <PQ> bid, out List <PQ> offer)
        {
            double last = price.Last0.Price.ToDouble();

            bid   = _Best(-1, last, price.BidDOMs);
            offer = _Best(1, last, price.OfferDOMs);
        }
Esempio n. 2
0
    static void Main(string[] args)
    {
        PriceClass   _priceClass = new PriceClass();
        Type         type        = typeof(PriceClass);
        PropertyInfo info        = type.GetProperty("Value");

        info.SetValue(_priceClass, 32, null);
        Console.WriteLine(_priceClass.Value);

        PriceStruct _priceStruct = new PriceStruct();

        type = typeof(PriceStruct);
        info = type.GetProperty("Value");
        info.SetValue(_priceStruct, 32, null);
        Console.WriteLine(_priceStruct.Value);

        object _bpriceStruct = new PriceStruct();  //Box first

        type = typeof(PriceStruct);
        info = type.GetProperty("Value");
        info.SetValue(_bpriceStruct, 65, null);
        Console.WriteLine(((PriceStruct)_bpriceStruct).Value); //now unbox and get value

        // Debugger.Break();
    }
Esempio n. 3
0
        public ProductInfo(int index, ContractStruct contract)
        {
            Index     = index;
            Exch      = contract.ExchangeName;
            Commodity = contract.ContractName;
            Date      = contract.ContractDate;
            Key       = $"{Exch},{Commodity},{Date}";
            TickSize  = contract.TickSize.ToDouble();
            PriceStruct price = Util.PATS.Price(Index);

            LimitUP   = price.LimitUp.Price.ToDouble();
            LimitDOWN = price.LimitDown.Price.ToDouble();
        }
    static void Main(string[] args)
    {
        PriceClass _priceClass = new PriceClass();
        Type type = typeof(PriceClass);
        PropertyInfo info = type.GetProperty("Value");
        info.SetValue(_priceClass, 32, null);
        Console.WriteLine(_priceClass.Value);

        PriceStruct _priceStruct = new PriceStruct();
        type = typeof(PriceStruct);
        info = type.GetProperty("Value");
        info.SetValue(_priceStruct, 32, null);
        Console.WriteLine(_priceStruct.Value);
        
         object _bpriceStruct = new PriceStruct(); //Box first
    type = typeof(PriceStruct);
    info = type.GetProperty("Value");
    info.SetValue(_bpriceStruct, 65, null);
    Console.WriteLine(((PriceStruct)_bpriceStruct).Value); //now unbox and get value

       // Debugger.Break();
    }
Esempio n. 5
0
        private void ExtendTick(PriceStruct price, out List <PQ> bid, out List <PQ> offer)
        {
            double lastPrice = price.Last0.Price.ToDouble();
            double bidInit = price.BidDOM0.Price.ToDouble();
            double offerInit = price.OfferDOM0.Price.ToDouble();
            int    bidPlusCnt = 0, offerPlusCnt = 0;

            if (lastPrice != 0)
            {
                if (lastPrice > bidInit | bidInit == 0)
                {
                    bidInit    = lastPrice;
                    bidPlusCnt = 1;
                }
                if (lastPrice < offerInit || offerInit == 0)
                {
                    offerInit    = lastPrice;
                    offerPlusCnt = 1;
                }
            }
            bid   = _Extend(bidInit, bidPlusCnt, -1, price.BidDOMs);
            offer = _Extend(offerInit, offerPlusCnt, 1, price.OfferDOMs);
        }
Esempio n. 6
0
 public static extern int ptGetPriceForContract(string ExchangeName, string ContractName, string ContractDate, ref PriceStruct CurrentPrice);
Esempio n. 7
0
 private void PATS_OnPriceUpdate(string key, PriceStruct price)
 {
     //throw new NotImplementedException();
 }
Esempio n. 8
0
 private void OnPriceTigger(string ExchangeName, string ContractName, string ContractDate, PriceStruct val)
 {
     if (PriceTigger != null)
     {
         PriceTigger(ExchangeName, ContractName, ContractDate, val);
     }
 }
Esempio n. 9
0
        void PriceUpdate(ref PriceUpdStruct value)
        {
            PriceStruct ps = new PriceStruct();

            ptGetPriceForContract(value.ExchangeName
                                  , value.ContractName
                                  , value.ContractDate, ref ps);

            OnPriceTigger(value.ExchangeName, value.ContractName, value.ContractDate, ps);
            if ((ps.ChangeMask & ptChangeBid) == ptChangeBid)
            {
            }
            if ((ps.ChangeMask & ptChangeOffer) == ptChangeOffer)
            {
            }
            if ((ps.ChangeMask & ptChangeImpliedBid) == ptChangeImpliedBid)
            {
            }
            if ((ps.ChangeMask & ptChangeImpliedOffer) == ptChangeImpliedOffer)
            {
            }
            if ((ps.ChangeMask & ptChangeRFQ) == ptChangeRFQ)
            {
            }
            if ((ps.ChangeMask & ptChangeLast) == ptChangeLast)
            {
            }
            if ((ps.ChangeMask & ptChangeTotal) == ptChangeTotal)
            {
            }
            if ((ps.ChangeMask & ptChangeHigh) == ptChangeHigh)
            {
            }
            if ((ps.ChangeMask & ptChangeLow) == ptChangeLow)
            {
            }


            if ((ps.ChangeMask & ptChangeOpening) == ptChangeOpening)
            {
            }
            if ((ps.ChangeMask & ptChangeClosing) == ptChangeClosing)
            {
            }



            if ((ps.ChangeMask & ptChangeBidDOM) == ptChangeBidDOM)
            {
            }
            if ((ps.ChangeMask & ptChangeOfferDOM) == ptChangeOfferDOM)
            {
            }



            if ((ps.ChangeMask & ptChangeTGE) == ptChangeTGE)
            {
            }
            if ((ps.ChangeMask & ptChangeOfferDOM) == ptChangeOfferDOM)
            {
            }


            if ((ps.ChangeMask & ptChangeSettlement) == ptChangeSettlement)
            {
            }
            if ((ps.ChangeMask & ptChangeIndic) == ptChangeIndic)
            {
            }
        }