jrefior has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I am writing some Perl code to import and analyze past stock transactions/trades from my personal OptionsXpress trade account. I am interested in developing this code in a way that it can be shared with others, e.g., via CPAN and/or github.

I have tried searching for other Perl modules that do this, but haven't really found anything quite like it yet. So for organization right now I am thinking something like:

StockAccount::Transaction <-- class for a single trade, buy or sell
StockAccount::TransactionSet <-- class for a sale tied to prior purchases that acquired what was sold
StockAccount::SymbolSet <-- class for the set of all TransactionSets for a given symbol
StockAccount::Import::OptionsXpress <-- import the OptionsXpress format

Down the road, one could add imports for other services or formats, graph or report generation, serialization/export, or anything else people wish to do with their personal past stock transaction data.

So for example, StockAccount::Transaction is a class for a stock trade, that contains the properties of a stock trade, such as price, quantity, commission, regulatory fees, date, etc.; and methods one might wish to use on such a thing, such as ->isSale() or ->printTransaction().

I like writing my own code. But I was wondering if there were opportunities for code reuse that I had missed that I should try to take advantage of. Anyone know of modules that already do this?

Thanks for your help. I've started reading about how to share a module on CPAN and prepare it for others (again), but if there are any particular guides or manuals you recommend for this I appreciate you pointing me in the right direction. Thanks again!

Just another Perl hacker,

John
  • Comment on Module for Personal Stock Account? Class for Stock Trade?

Replies are listed 'Best First'.
Re: Module for Personal Stock Account? Class for Stock Trade?
by 1s44c (Scribe) on Jul 27, 2014 at 11:31 UTC

    I don't see anything relevant on CPAN either. I'd keep it as generic as possible by keeping the OptionsXpress stuff away from the Transaction and Symbol stuff.

    It sounds like a fun project.

      Thanks @ls44c.

      I got one reply on PrePAN that asserted I should put my StockAccount modules under 'Finance::'. See http://prepan.org/module/nY2FAS627KQ .

      So then I'm looking at something like:

      Finance::StockAccount
      Finance::StockAccount::Transaction
      Finance::StockAccount::Utilities
      Finance::StockAccount::Import
      Finance::StockAccount::Import::OptionsXpress

      Look good? Thanks!