Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ToStringOut() for series #1150

Draft
wants to merge 6 commits into
base: v3
Choose a base branch
from
Draft

feat: ToStringOut() for series #1150

wants to merge 6 commits into from

Conversation

DaveSkender
Copy link
Owner

@DaveSkender DaveSkender commented Jan 26, 2024

Description

This is a quirky helper utility to convert ISeries (quotes and results lists) to a fixed width, CSV, or JSON string. Mostly, I'm thinking this is helpful anyone debugging or wanting to output something to Console for quick visual inspections or general development sharing. Default is OutType.FixedWidth, since I mostly had Console output and .NET Fiddle use in mind.

   i  Timestamp      Open     High      Low    Close     Volume
---------------------------------------------------------------
   1  2017-01-03   212.71  213.350  211.520  212.570   96708880
   2  2017-01-04   212.64  214.220  212.638  213.648   83348752
   3  2017-01-05   213.14  214.060  213.020  213.685   82961968
   4  2017-01-06   213.41  215.170  213.414  214.318   75744152
   5  2017-01-09   213.87  214.530  213.866  214.193   49684316
   6  2017-01-10   214.03  214.890  213.520  214.083   67500792

To do

  • depends on merge of feat: Full chain streaming, increment prototypes #1092, since it restructures IResult to be parameterless
  • question: isn't there a built-in set of converters that might work better here? seems like we're re-engineering something that probably already exists in C# features.
  • question: any way to use inner override of result class ToString()? Probably not.
  • fix: order date as first property, it's inherited, so it is always at the end right now
  • fix: use of unused arguments for certain OutType values
  • fix: formatting issues for date. For OutType.FixedWidth, it would ideally be the smallest format possible, keeping in mind that bars could be high frequency date/time values or wider.
  • consider overload .ToString(int limitQty) or .ToString(int startIndex, int endIndex)
  • add separate backlog items if some classes might have their own (property, type, value, description (from XML docs)), ref:
    Property   Type          Value  Description
    -------------------------------------------------------------------
    Timestamp  DateTime 2024-02-02  The close date/time for this period
    Size       Decimal        3.00  High - Low price
    Body       Decimal        1.00  | Open - Close | (absolute value)
    UpperWick  Decimal        1.00  High - max(Open, Close)
    ...
  • fix: overall performance, needs major refactoring
  • add real unit tests

@DaveSkender DaveSkender added the on hold On hold / waiting label Jan 26, 2024
@DaveSkender DaveSkender self-assigned this Jan 26, 2024
@DaveSkender DaveSkender added this to the v3 milestone Jan 26, 2024
@DaveSkender
Copy link
Owner Author

Note: overriding ToString() doesn't work on enumerable, but does work for base types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold On hold / waiting
Projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant