Ejemplo n.º 1
0
        /// <summary>
        /// Writes this row to csv format
        /// </summary>
        public string ToCsv()
        {
            var encodedExchange = string.Empty;

            if (PrimaryExchange == Exchange.UNKNOWN)
            {
                if (DataMappingMode != null)
                {
                    // be lazy, only add a comma if we have a mapping mode after
                    encodedExchange = ",";
                }
            }
            else
            {
                encodedExchange = $",{PrimaryExchange.Code}";
            }
            var mappingMode = DataMappingMode != null ? $",{(int)DataMappingMode}" : string.Empty;

            return($"{Date.ToStringInvariant(DateFormat.EightCharacter)},{MappedSymbol.ToLowerInvariant()}{encodedExchange}{mappingMode}");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes this row to csv format
        /// </summary>
        public string ToCsv()
        {
            var encodedExchange = PrimaryExchange == PrimaryExchange.UNKNOWN? string.Empty : $",{Convert.ToChar((byte) PrimaryExchange)}";

            return($"{Date.ToStringInvariant(DateFormat.EightCharacter)},{MappedSymbol.ToLowerInvariant()}{encodedExchange}");
        }