I'd like to suggest that you take a look at bookwerx.
https://bitcointalksearch.org/topic/bookwerx-the-multicurrency-bookkeeping-api-5197686The foundation of
any financial analysis starts with proper bookkeeping of the underlying transactions. There is a tried-n-true method literally a mere few centuries old, called double-entry bookkeeping (the debits and credits thingy) that does this. The various crypto sites that I've ever seen apparently view bookkeeping as a nuisance that distracts them from their primary goal. So whatever balance inquiry/transaction history/financial analyses features they offer are at best random fragments of information.
With bookwerx you can define the currencies and accounts that you use and then enter transactions using the double-entry bookkeeping system. The advantage of doing this is that said model just happens to align well with the reality of recording financial transactions. If you study this, you will find that you can record the information about accounts that you need, and then later retrieve useful information such as balances, profits-n-losses, and transaction history.
As a learning exercise I encourage you to try this with spreadsheets and/or home-grown methods. You'll quickly discover that there are some nettle-some issues in this seemingly simple task that will quickly choke lesser methods.
Another common woe with any crypto market that I've ever seen is their confusion with round-off error. Sure, price x quantity will frequently give us some round-off error initially. But once the actual amounts are determined, we want to accurately record
all of these f**kin decimal places. We later want to see
all of this in any subsequent reporting. Even if we want to view fewer decimal places in the UI, we still want some indication that hidden details exist, but are merely suppressed at the moment. Bookwerx eats this for breakfast.
Bookwerx is implemented as a Restful API. You GET, POST, PUT, 'n' DELETE what you need to in order to CRUD all the objet d'bookkeeping that are relevant for your use, as well as to extract balance and profit-n-loss info from the resulting collection of information.
Although the API is a great way for your automated processes to interface with bookkwerx, it's not good for human beans. So bookwerx also includes an example UI at
http://23.253.160.60/, that uses the API to do the dirty work.
Good luck with your search for solutions and I encourage you to give bookkwerx a consideration.