You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm using online code sharing tools like https://dotnetfiddle.net I like to use Console.WriteLine(results) to simply visualize on of the ISeries or IReusable records from the indicators results.
These POCO classes have their own unique set of properties. I'd like the output to look like this example, for all such property types, where the description is based on XML comments. Any JsonIngore attributed fields are excluded.
# inputsprivate static readonly CultureInfo EnglishCulture = new("en-US", false);DateTime timestamp = DateTime.TryParse("2017-02-03", EnglishCulture, out DateTime d) ? d : defaultQuote quote = new Quote(timestamp,216.18,216.87,215.84,216.67,85273832)
# string output for Quote classProperty Type Value Description-------------------------------------------------------------------Timestamp DateTime 2024-02-02 Gets the date/time of the record.Open Decimal 216.18 Aggregate bar's first tick priceHigh Decimal 216.87 Aggregate bar's highest tick priceLow Decimal 215.84 Aggregate bar's lowest tick priceClose Decimal 216.67 Aggregate bar's last tick priceVolume Decimal 85273832 Aggregate bar's tick volume
publicinterfaceIReusable:ISeries{/// <summary>/// Value that is passed to chained indicators./// </summary>[JsonIgnore]doubleValue{get;}}
ISeries interface
/// <summary>/// Time-series base interface./// </summary>publicinterfaceISeries{/// <summary>/// Gets the date/time of the record./// </summary>DateTimeTimestamp{get;}}
All fields can have named formatting preferences in args, for example:
Dictionary<string,string>args new()={{"Open","N2"},{"High","N2"},{"Low","N2"},{"Close","N2"},{"Volume","N0"},// No decimal places{"Date","yyyy-MM-dd HH:mm"}// Include milliseconds};
args can also target specific primitive types, but also allow overrides based on sequencing in the args list (last format wins)
Dictionary<string,string>args new()={{"decimal","N2"},{"Volume","N0"},// override decimal places{"Date","yyyy-MM-dd HH:mm"}// Include milliseconds};
when args or individual properties aren't covered, do not apply formatting
the problem
When I'm using online code sharing tools like https://dotnetfiddle.net I like to use
Console.WriteLine(results)
to simply visualize on of theISeries
orIReusable
records from the indicators results.These POCO classes have their own unique set of properties. I'd like the output to look like this example, for all such property types, where the description is based on XML comments. Any
JsonIngore
attributed fields are excluded.References
Quote class
IReusable
interfaceISeries
interfaceRelated to:
ISeries
lists #1280an idea
All fields can have named formatting preferences in
args
, for example:args
can also target specific primitive types, but also allow overrides based on sequencing in the args list (last format wins)when args or individual properties aren't covered, do not apply formatting
code example
The text was updated successfully, but these errors were encountered: