private string OHLCQuoteToString(OHLCQuote q) { string res = ""; try { res = string.Format("{0} @ {1}: Day={2},Open={3},High={4},Low={5},Close={6},Volume={7}", q.Symbol, q.Timestamp.ToString("yyyy-MM-dd HH:mm"), q.Day, q.FormatValue(q.Open, NumericFormat.Default), q.FormatValue(q.High, NumericFormat.Default), q.FormatValue(q.Low, NumericFormat.Default), q.FormatValue(q.Close, NumericFormat.Default), q.Volume); } catch (Exception ex) { res = "Error converting data from OHLC quote to string: " + ex.Message; } return(res); }
public static string OhlcQuoteToString(OHLCQuote q) { var res = ""; try { res = $"{q.Symbol} @ {q.Timestamp:yyyy-MM-dd HH:mm}: Day={q.Day},Open={q.FormatValue(q.Open, NumericFormat.Default)},High={q.FormatValue(q.High, NumericFormat.Default)},Low={q.FormatValue(q.Low, NumericFormat.Default)},Close={q.FormatValue(q.Close, NumericFormat.Default)},Volume={q.Volume}"; } catch (Exception ex) { res = "Error converting data from OHLC quote to string: " + ex.Message; } return(res); }