DaveSkender / Stock.Indicators

Stock Indicators for .NET is a C# NuGet package that transforms raw equity, commodity, forex, or cryptocurrency financial market price quotes into technical indicators and trading insights. You'll need this essential data in the investment tools that you're building for algorithmic trading, technical analysis, machine learning, or visual charting.

Home Page:https://dotnet.StockIndicators.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Native support of Pandas DataFrame?

DaveSkender opened this issue · comments

We've seen several Python users get frustrated over issues related to converting quotes from Pandas DataFrame into iterable quotes. Are there opportunities to add a native strongly typed DataFrame interface implementation to the .NET library? I'm assuming this might then enable better interface design for our Python implementation.

Some paths to explore:

  1. improve existing Python stock-indicators package code to be more resilient or to provide enhanced error handling / messages
  2. improve documentation website by either / or:
  3. the mentioned native implementation of .NET DataFrame

For now, to help users, I've started a specific support discussion on the topic, including a list of reported examples.

cc: @LeeDongGeon1996

Looks like 2 is almost done :)
About 1, how do you think about providing helper method for converting into Iterable[Quote]?

About 1, how do you think about providing helper method for converting into Iterable[Quote]?

I think what you've done with Exception handling might be enough; unless you can think of some better utility method that'd work better. Right now they have to do some custom transform with a number of methods using zip() or numpy.vectorize() or iterrows(), and to do it correctly with all necessary data type conversions and considerations, with code like:

quotes_list = [
    Quote(d,o,h,l,c,v) 
    for d,o,h,l,c,v 
    in zip(df['date'], df['open'], df['high'], df['low'], df['close'], df['volume'])
]

A utility would have more validation and error handling and be in a somewhat simpler interface, like:

quotes = df.to_quotes('date', 'open', 'high', 'low', 'close', 'volume');

or

quotes = df_to_quotes(df['date'], df['open'], df['high'], df['low'], df['close'], df['volume']);

For this issue, I’m not sure where to go at this point. The example usage we’ve given so far somewhat explains how to use a DataFrame, maybe that’s enough?

@DaveSkender
I also think that what we've done for dealing with DataFrame is enough. Most of cases were the problem of what the beginners are usually struggled with (except for locale issue). So now let's just see how it goes.