示例#1
0
        // Constructor 4 : Keys + Data
        public Bond_Line(DateTime currentDate, DBID ticker, double CleanPriceBid_, double CleanPriceAsk_, double CleanPriceMid_,
                         double DirtyPriceBid_, double DirtyPriceAsk_, double DirtyPriceMid_,
                         double YieldToMaturityBid_, double YieldToMaturityAsk_, double YieldToMaturityMid_,
                         double AssetSwapSpreadBid_, double AssetSwapSpreadAsk_, double AssetSwapSpreadMid_)
        // double CDS1Y_, double CDS3Y_, double CDS5Y_, double CDS7Y_, double CDS10Y_,

        {
            // Keys
            Date = currentDate;
            DBID = ticker.ToInt();

            // Data
            CleanPriceBid = CleanPriceBid_;
            CleanPriceAsk = CleanPriceAsk_;
            CleanPriceMid = CleanPriceMid_;

            DirtyPriceBid = DirtyPriceBid_;
            DirtyPriceAsk = DirtyPriceAsk_;
            DirtyPriceMid = DirtyPriceMid_;

            YieldToMaturityBid = YieldToMaturityBid_;
            YieldToMaturityAsk = YieldToMaturityAsk_;
            YieldToMaturityMid = YieldToMaturityMid_;

            AssetSwapSpreadBid = AssetSwapSpreadBid_;
            AssetSwapSpreadAsk = AssetSwapSpreadAsk_;
            AssetSwapSpreadMid = AssetSwapSpreadMid_;
        }
        // Constructor 5 : From Dict of nullable doubles
        public InterestRate_Line(DateTime currentDate, DBID ticker, Dictionary <String, Double?> data)
        {
            // Keys
            Date = currentDate;
            DBID = ticker.ToInt();

            // Data
            Bid  = data["Bid"];
            Ask  = data["Ask"];
            Last = data["Last"];
        }
        // Constructor 4 : Keys + Data
        public InterestRate_Line(DateTime currentDate, DBID ticker, double Bid_, double Ask_, double Last_)
        {
            // Keys
            Date = currentDate;
            DBID = ticker.ToInt();

            // Data
            Bid = Bid_;
            Ask = Ask_;
            Ask = Last_;
        }
示例#4
0
        // ************************************************************
        // INDEXORS
        // ************************************************************


        public IDtoken this[DBID dt]
        {
            get
            {
                return(_internalData[dt]);
            }

            set
            {
                _internalData[dt] = value;
            }
        }
        public Dictionary <string, string> GetExternalIdentifiers(DBID DBID_)
        {
            myDB_Connector dbCom   = new myDB_Connector();
            IDtoken        refLine = dbCom.Reference(DBID_);

            Dictionary <string, string> result = new Dictionary <string, string>();

            foreach (string s in refLine.GetExternalIdentifiers())
            {
                result[s] = (string)refLine[s];
            }


            return(result);
        }
        public object GetReferenceItem(DBID id, string key)
        {
            object result = new object();

            // Loop through the ref table in memory
            foreach (IDtoken line in referenceTable)
            {
                if (line["DBID"] == id)
                {
                    result = line[key];
                }
            }

            // Return results
            return(result);
        }
        public IDtoken Identify(DBID dbid)
        {
            // IDtoken result = TokenFactory.New(dbid);

            // Loop through the ref table in memory
            foreach (IDtoken line in referenceTable)
            {
                if ((int)line["DBID"] == dbid.ToInt())
                {
                    return(line);
                }
            }

            // Return results
            throw new System.ArgumentException("IDException", "Invalid DBID provided to reference manager.");
        }
示例#8
0
        // Constructor 5 : From Dict of nullable doubles
        public Equity_Line(DateTime currentDate, DBID ticker, Dictionary <String, Double?> data)
        {
            // Keys
            Date = currentDate;
            DBID = ticker.ToInt();

            // Data
            Open          = data["Open"];
            High          = data["High"];
            Low           = data["Low"];
            Close         = data["Close"];
            Bid           = data["Bid"];
            Ask           = data["Ask"];
            Volume        = data["Volume"];
            AdjustedClose = data["AdjustedClose"];
        }
示例#9
0
        public static IDtoken GenerateDBID(DBID ReferenceDBID, string Bloomberg = "", string Reuters = "", string Sophis = "",
                                           string MSD  = "", string MarketMap = "", string Markit = "",
                                           string FRED = "", string Yahoo     = "", string Google = "", string ISIN = "")
        {
            Dictionary <string, string> _extIds = new Dictionary <string, string>()
            {
                { "Bloomberg", Bloomberg.ToUpper() }, // Careful with the upper/lower case...
                { "Reuters", Reuters },
                { "Sophis", Sophis },
                { "MSD", MSD },
                { "MarketMap", MarketMap },
                { "Markit", Markit },
                { "FRED", FRED },
                { "Yahoo", Yahoo },
                { "Google", Google },
                { "ISIN", ISIN }
            };


            // Create container for potential matching lines
            // List<IDtoken> results = new List<IDtoken>();

            // Load Reference Manager (singleton)
            ReferenceManager _referenceManager = ReferenceManager.Factory;

            // Get a new DBID from Reference Manager (= max of column DBID + 1)
            DBID newDBID = _referenceManager.GetNewDBID();

            // Replace DBID from existing token
            IDtoken refToken = TokenFactory.New(ReferenceDBID);

            // New token for output
            IDtoken newToken = new IDtoken();

            newToken.SetDBID(newDBID);

            // Replace all sources
            foreach (string source in _extIds.Keys)
            {
                newToken[source] = _extIds[source];
            }

            // Return the new token
            return(newToken);
        }
示例#10
0
        // Constructor 4 : Keys + Data
        public Equity_Line(DateTime currentDate, DBID ticker, double argOpen,
                           double argHigh, double argLow, double argClose, double argBid,
                           double argAsk, double argVolume, double argAdjClose)
        {
            // Keys
            Date = currentDate;
            DBID = ticker.ToInt();

            // Data
            Open          = argOpen;
            High          = argHigh;
            Low           = argLow;
            Close         = argClose;
            Bid           = argBid;
            Ask           = argAsk;
            Volume        = argVolume;
            AdjustedClose = argAdjClose;
        }
示例#11
0
        // Constructor 5 : From Dict of nullable doubles
        public Bond_Line(DateTime currentDate, DBID ticker, Dictionary <String, Double?> data)
        {
            // Keys
            Date = currentDate;
            DBID = ticker.ToInt();

            // Data
            CleanPriceBid = data["CleanPriceBid"];
            CleanPriceAsk = data["CleanPriceAsk"];
            CleanPriceMid = data["CleanPriceMid"];

            DirtyPriceBid = data["DirtyPriceBid"];
            DirtyPriceAsk = data["DirtyPriceAsk"];
            DirtyPriceMid = data["DirtyPriceMid"];

            YieldToMaturityBid = data["YieldToMaturityBid"];
            YieldToMaturityAsk = data["YieldToMaturityAsk"];
            YieldToMaturityMid = data["YieldToMaturityMid"];

            //AssetSwapSpreadBid = data["AssetSwapSpreadBid"];
            AssetSwapSpreadMid = data["AssetSwapSpreadMid"];
            //AssetSwapSpreadAsk = data["AssetSwapSpreadAsk"];
        }
 public EquityVolatility_Line(DateTime currentDate, DBID argDBID)
 {
     Date = currentDate;
     DBID = argDBID;
 }
示例#13
0
 public override void SetDBID(DBID dbid)
 {
     this._DBID = dbid;
 }
示例#14
0
 // Constructor 3 : Keys only
 public InterestRate_Line(DateTime currentDate, DBID ticker)
 {
     Date = currentDate;
     DBID = ticker.ToInt();
 }
示例#15
0
 // Constructor 3 : Keys only
 public Bond_Line(DateTime currentDate, DBID ticker)
 {
     Date = currentDate;
     DBID = ticker.ToInt();
 }
 public virtual void SetDBID(DBID myId)
 {
     throw new System.ArgumentException("SetDBIDException", "Generic database line 'SetDBID' must be overridden.");
 }