/// <summary> /// Creates a Spark.Stock reference for the specified security and exchange. /// </summary> /// <param name="exchangeId">Security exchange</param> /// <param name="exchange">Exchange reference generated by the method</param> /// <returns>TRUE if Spark was able to create the specified exchange reference, else FALSE</returns> internal static bool GetSparkExchange(string exchangeId, out Spark.Exchange exchange) { Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.fff") + "\t" + "Creating rreference to Spark exchange '" + exchangeId + "'..."); exchange = new Spark.Exchange(); if (!Spark.GetExchange(ref exchange, exchangeId)) { string error = Spark.DescribeError(Spark.GetLastError()); Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.fff") + "\t" + "Creating rreference to Spark exchange '" + exchangeId + "' failed: " + error); return(false); } else { Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss.fff") + "\t" + "Creating rreference to Spark exchange '" + exchangeId + "' complete"); return(true); } }