[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Accessing fundamentals with Python

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 32
Thread images: 4

File: python.jpg (52KB, 460x288px) Image search: [Google]
python.jpg
52KB, 460x288px
I've been playing around with fundamental analysis in Python like many people here do. The problem is that I can only find modules that have access to limited fundamentals.

For instance, I can't access things like payout ratios and debt. I'd attempt it manually with Yahoo Finance, but the tags people use to access that stuff don't even exist for payout ratios and debt. The last option seems to be to manually parse some finance/screener site for these additional values, which seems pretty annoying given how these sites change every so often.

I should mention I'm Australian so I'm interested in the ASX. I have a nabtrade account but that seems like a dead as far as downloading fundamentals go. I feel like calling them and telling them their screener is shit and I want the data to do with it what I want.

Is there a better or easier way? I'm now even considering subscribing to some service that will give me what I want. pls halp
>>
>>1066589
Have you tried Quandl?
>>
>>1066599
I was looking and Quandl earlier. It looked interesting but I couldn't quite ascertain whether or not it could access all that data. Can it?

Thanks for reply, btw.
>>
>>1066676
Should. It's pretty great.

Maybe try asking them what specifically you need?
>>
File: pythonlogo.jpg (46KB, 680x459px) Image search: [Google]
pythonlogo.jpg
46KB, 680x459px
>>1066682
I just made an account and will trawl through it. It does look pretty comprehensive.

I thought something as obvious as debt would be easy to access.

While I'm trawling, let this be a Python thread. I fucking love Python now.
>>
>>1066700
I'd program that little snake to slither up my asshole if I could.
>>
>>1066727
I think there's a module for that.
>>
>>1066589
if you're just looking at basic metrics finviz . com has a pretty good screener. not sure if asx is covered and not going to check.

i also hope you don't have a fantasy of letting your python program do all the hard work for you, you're still going to have to read 10-q's and k's or whatever australia's equivalent is, the screener will just help you with some of the needle and the haystack. even then it still might be better to just pick a core group and keep on top of the financial reports, the way all these companies report and what it all means varies far too wildly for simply metric analysis to really be fruitful.
>>
>>1066811
I am pretty much looking to build my own customisable scanner. I would like to be able to take any function I want, compute it for the set of all stocks on the ASX, order that set then the top of that list can spur more research.

Python isn't doing the hard work, just the boring work. The hard work is choosing the function and deciding whether or not it's meaningful, then doing the second round of research.

I'm sick of using stock screeners, widdling down to a manageable bunch of stocks based on simple (and in my opinion often naive) functions, then doing the rest of the numerical research manually by entering numbers and doing my own computations elsewhere.
>>
>>1066845
Plus, I could schedule a script to run daily and provide alerts based on any arbitrary condition I want. I don't think that's asking too much.
>>
i wish i could motivate myself to learn python more
but i just starting something new is always a struggle for me. like, what do i do first? where do i learn all of the different libraries and whatever else stuff is called.
>>
>>1066856
I'd suggest Code Academy for the basic syntax,
https://www.codecademy.com/learn
and the Python site for the standard library
https://docs.python.org/3/library/

Then if you want to do something, assume you can then look up how to do it. It's worked for me so far, there are that many elegant modules for all sorts of stuff.

Python is really easy to use, in fact I can see it ruining me for other more burdensome languages.

Then depending on what you do you might use numpy, scipy etc for numerical analysis. That's what I do. I am basically replacing everything I used to do in Matlab by doing it in Python. If you download Anaconda it includes an IDE called Spyder which is decent, and all the usual mathsy modules.
>>
>>1066863
There are a lot of good and easy to use modules that do what I wanted to do in the original post, but minus things like calling debt and payout ratio numbers.

https://pypi.python.org/pypi/yahoo-finance

for instance. Also, check out this page for .whl files which make it easy to install packages: http://www.lfd.uci.edu/~gohlke/pythonlibs/

Then you can go to the file location in the command prompt and use the command pip install package_name.whl and bam it's done. I got into Python to solve certain convex optimisation problems and I installed the cvxpy package and implemented it in a few lines of code. It was a beautiful moment in my life.
>>
>>1066762
good old import anuspython as snek
>>
Since we're talking about python, out of curiosity how do I install numpy/scipy without using distributions?
>>
>>1066894
Not quite sure what you mean, but you can install them from wheel files on this page: http://www.lfd.uci.edu/~gohlke/pythonlibs/
that seems to be the simplest.
>>
>>1066917
Ayyy Lmao. You a UCI student?
>>
>>1067863
I am not. You?
>>
File: automated research.png (13KB, 508x211px) Image search: [Google]
automated research.png
13KB, 508x211px
I think I'm starting to get something happening with this, too. I'm still testing and debugging.

Anyone else automate any aspect of their financial research? I'd like to hear about it.
>>
>>1066863

Can you post one of your basic analysis scripts for some basic stuff as an example?
>>
>>1070219
It's not quite there atm, I've been learning on on the job cause I only picked up Python like a few weeks ago to do some unrelated shit and immediately got this idea cause I hate typical stock screeners. Is there any particular part you wanna see?

The meat of it atm is a simple formula for intrinsic value using ROE, book value and dividend payout ratio, as well as a required return.

I use the module yahoo-finance to get values, and I compute ROE and payout ratio manually. Shares are represented as objects (which is probably unnecessary, but I want to do other things in the future so it might come in handy then).

I am using the csv module to output the data to a spreadsheet type thing.

Currently I'm getting a few weird values peppered throughout (like that ABT being $0.0, that shouldn't be there), I'm trying to figure out how much is the code and how much is Yahoo not having it.

Also, I can't yet find a way to grab debt figures from the internet, which sucks because too high debt is a deal breaker for me so I'd like to filter it out.

When I get something that's consistently doing what I want I'll stick it on dropbox or something and link it here. I wouldn't mind getting some people who are good with Python talking cause I wanna learn what can be done in the way of automating financial research, and also machine learning interests me a lot.
>>
>>1070246
Also, my internet keeps crapping out (th-thanks Telstra) so I need to add code to let it read the existing csv file and start where it left off. I haven't gotten past the letter E yet when running it before I lose my connection.
>>
File: spreadsheet.png (43KB, 390x891px) Image search: [Google]
spreadsheet.png
43KB, 390x891px
This is what the csv looks like atm. Clearly many of those figures don't belong there, especially when a company has negative earnings and negative equity, I got to set those to ROE = 0.
>>
>>1070246
something i want to try is creating a floating market cap index of a portfolio
im making a lot of progress as of learning python now, so eventually, i should be able to do that
>>
>>1071556
Python is so beautifully easy if you have any programming experience at all.

The hard part seems to be getting good data, as discussed above. I'm still working on it because I really want to get a slab of data to work with. I'm trying to follow where stock screening sites get their data from, I think it's all like big contracts and they don't dole it out for personal use.

Like I said, my end game goal with this stuff is a fully customisable stock screener where you can basically search and sort for basically formula or set of conditions you can imagine. Sort of like an SQL thing, but I guess more specialised for finance and stocks. I know people already have things like that, but it's all premium sort of shit, very inaccessible, although I'm starting to think it's because of the data getting problem.

Given the data, any half decent Python programmer could churn out some good shit, and a good programmer could make something quite beautiful. I'm still not sure what's out there already, but I haven't see anything, especially for the ASX.
>>
>>1071659
do you know what 10 q's are? maybe it's 10 k... but it's the quarterly report, usually. you can get monthly and annuals, but each company has an investor section on their site to grab their latest reports.

im pretty sure you'd be able to use that?
>>
>>1071734
Yeah, it's not so much getting the data, it's the doing it 2000 times, or getting it in a standardised way.

I'm not so hip to grabbing data of random pages like that, but I'm willing to learn if it comes down to it.
>>
>>1071806
unless you can get it from your broker?
>>
>>1071819
I looked into that, couldn't see any obvious way. I might actually call them and see how one could do it, but I'd suspect they'd not approve. You'd think they'd make it available but.
>>
The easier I can access bulk data, the more likely I am to make a trade, so that's fees to them.
>>
>>1071830
they do get paid (by you) to answer such questions. anyhow, im sure they'd rather you at least be a potential customer and should be extremely professional towards you.
>>
>>1071832
That's what I figure. Clearly they already have a database of exactly what I want, including all the debt numbers, both long term and short term.

I feel like a solution is out there, it's probably easier than I'm making it. Once I get access to nice data I'm gonna go to town with it.

Even more interesting would be historical data of things like debt, earnings and cashflow. I have a hunch that those things can indicate a lot. For instance, if I found something like for a certain company if their earnings/cashflow decline a certain amount in consecutive quarters then there's a whatever% chance of whatever.
Thread posts: 32
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.