Author

Topic: [GLBSE] API Frontend to keep track of assets and returns. (Read 1802 times)

sr. member
Activity: 285
Merit: 250
Will resume improving this now that pirate is a bust Smiley
sr. member
Activity: 285
Merit: 250
looks very useful! unfortunately i can't download the archive to test it out Sad

Sorry, my vps was down.   It is back up now with the newest version Smiley
legendary
Activity: 1834
Merit: 1019
looks very useful! unfortunately i can't download the archive to test it out Sad
sr. member
Activity: 285
Merit: 250
Update:  Moved all rounding to right before display so it does not affect other calcuations.  Cleaned up presentation.  Added 'price gap' column.
donator
Activity: 164
Merit: 100
sr. member
Activity: 285
Merit: 250
The numbers for all weekly dividend assets and all summary items should be correct now.  Several bugs have been fixed.  This should be ready to go Smiley  Please report any bugs or feature requests here.

final = balance + total_sells + total_withdrawals - total_deposits - fees_to_sell
sr. member
Activity: 464
Merit: 250
I do use it. Its nice for me to see how much I am making or loosing a week Smiley.

I am going to toss sp0tter a share for his work (now what do I have that's cheap)

hero member
Activity: 700
Merit: 507
Useful little script :0)

I think this will be something to keep an eye on!
sr. member
Activity: 285
Merit: 250
I'd love to see how much I've bought my shares for and for how much I already sold them + dividends gained - fees paid.

Also, why PHP in the first place?

Just for shits and giggles.  I wanted to do some php....  I wanted reports on my GLBSE.. bam!


Edit:
The avg cost is the average cost that you paid.. and that is all bought - all sold / count.
legendary
Activity: 2618
Merit: 1007
I'd love to see how much I've bought my shares for and for how much I already sold them + dividends gained - fees paid.

Also, why PHP in the first place?
sr. member
Activity: 285
Merit: 250
Thanks Sp0tter!  I made a cl script to do some of this, I like yours better tho.

I see you're doubling the div/day of YABMC... can you instead grab the last two dividends and divide by the actual number of days between them?  I suspect there may be more tickers with irregular (or non-weekly) dividends, such that always dividing by 7 and having to special-case them could be too much work.

FWIW - I see nothing shady in there. :-)


I have devoted attention so far to the assets that I actually have.  I will try to cover as manay as possible as time goes on.

Eventually I plan to make a separate data file that lists each asset and describes it's type and payout scheme.  For the mh/s bonds, I will calculate the current PPS and use what it "should be" for the dividend estimation.

Thanks for checking over the script and verifying it for others.  This is my first time using php, I do most of my life in c++, and most of my scripting in perl...  it's not so bad... php makes me feel like a really smart ...11 year old boy.   I appreciate the feedback.    Smiley

sr. member
Activity: 278
Merit: 250
Thanks Sp0tter!  I made a cl script to do some of this, I like yours better tho.

I see you're doubling the div/day of YABMC... can you instead grab the last two dividends and divide by the actual number of days between them?  I suspect there may be more tickers with irregular (or non-weekly) dividends, such that always dividing by 7 and having to special-case them could be too much work.

FWIW - I see nothing shady in there. :-)
sr. member
Activity: 285
Merit: 250
sr. member
Activity: 285
Merit: 250
I created a front-end script to access the GLBSE  api and display helpful information about assets and return on investments.  I hope you find it useful.  

Please report any bugs or feature requests here.



md5sum
source488b8027b4b7287cb2f9e262bb9464b9
assets_2012-07-03_1341340694.tar.gz



Instructions
1. Extract to a public html folder.
2. Edit the sample_key file and move it to a non-public folder.
3. Edit $key_file in assets.php to point to the key file.
4. Download/Copy your account_history.csv from GLBSE to the same folder as assets.php.  Update this file when you trade assets or receive dividends.  (Currently there is not a simple way through the private API to check dividends, therefore you must fetch the csv manually.  I have contacted support and it is on their todo list.)

If you do not have a web server set up, you can just run 'php assets.php > assets.html' in linux and then point your web browser to the html file.

Known Issues
1. Warning / Notice output will display if your web server is set to display all of these.  Will fix these.
2.  Currently per/share dividends are only reported correctly for assets which are paid weekly.  (This does not affect cumulative dividends, but only the return on investment estimates).
3.  Occasionally there will be a timeout because of how slowly glbse.com responds.

Please post feedback here or talk to me in #btcguild on irc.

Warning... use at your own risk... (it can't be riskier than 7% interest bonds though right?)  Please check the script and make sure there is nothing shady in there before using.  I do my best to test everything, but will not be responsible for any losses due to the use of this script.
Jump to: