Stock technical analysis software

  • Guest, it's time once again for the hotly contested and exciting FoH Asshat Tournament!



    Go here and fill out your bracket!
    Who's been the biggest Asshat in the last year? Once again, only you can decide!

Unidin_foh

shitlord
0
0
Tuco said:
Hehe, when Lyrical said no one wants to show you their portfolio, he didn"t mean fake portfolio. It"s easy to make a set of portfolio"s and show off the best one! Just fuckin" with you prescient.

I did some more research and started the development of my project. I"m very happy/lucky to have stumbled upon the yahoo api. Maybe I"m missing it but there"s a real lack of content on the internet for doing what I"m doing (Which makes me think I"m just missing on some advanced stock analysis project that makes everything obsolete. Like being disappointed in the options of consumer operating systems while not knowing about the Windows OS"). I expected there to be a very complete open source C# or java application that taps into a database like yahoo"s finance and runs all the analyses I want.

Instead I"m finding a lot of outdated open source libraries and a suite of decent non-open source applications like metatrader that use some licensed servers for trading.

Either way I"ve got what I need. I can quickly get the financial data of any NYSE listed stock, with a daily readout of the open, high, low, close, volume and adjusted close. With this I should be able to build analysis using everything in the book I"m reading and run simulations.

I"ll keep this thread updated with what I come up with or if I find something more suitable to what I"m doing. I should find a library that does this and also a library meant to chart this kind of thing.
It can be done, but it takes some luck and the ability to swallow some bad picks. This is my etrade account that I"ve been trading sparingly over the last couple of years. You are right though that treating it like "fun money" makes the losses easier to stomach. In my case I"ve done ok on some stocks, really badly on others, and hit the jackpot on one.
 

FulorianC_foh

shitlord
0
0
LVS is one of those things that make no sense whatsoever. Sheldon Adelson has proven over the years he cannot manage that company worth shit, they just turned their first profit in 4 years (they were losing money before the financial crisis hit - a retarded donkey could make a 10% ROE running a lemonade stand in early 2007). Yet if you ignore the last 3 quarters and pretend that the most recent quarter"s profit was accurate for the whole year, you"d have a 120 trailing P/E and trading at 5x book.

Also, you can discount 4 billion of that common shareholders equity, since that was created by two shareholder issuances to none other than Sheldon. That was an imaginary growth in the common equity. In reality, common equity is 2 billion. So really, you"re trading at 15x book.

Sheldon Adelson is a genius at making people throw their money away on gambling. Don"t pretend that"s just slot machines. He gets them to throw it away by inflating his stock.

Don"t bet too hard on Macau. LVS had better do GANGBUSTERS or it"s going to become a massive bursting bubble.

Not to mention, it"s your largest position, so you"ve got way too many eggs in that basket. You really should go ahead and sell at minimum half of your position in LVS... the ride may keep up for a bit, but you"re going to get burned eventually if you get greedy on a 1800% return.
 

Unidin_foh

shitlord
0
0
FulorianC said:
LVS is one of those things that make no sense whatsoever. Sheldon Adelson has proven over the years he cannot manage that company worth shit, they just turned their first profit in 4 years (they were losing money before the financial crisis hit - a retarded donkey could make a 10% ROE running a lemonade stand in early 2007). Yet if you ignore the last 3 quarters and pretend that the most recent quarter"s profit was accurate for the whole year, you"d have a 120 trailing P/E and trading at 5x book.

Also, you can discount 4 billion of that common shareholders equity, since that was created by two shareholder issuances to none other than Sheldon. That was an imaginary growth in the common equity. In reality, common equity is 2 billion. So really, you"re trading at 15x book.

Sheldon Adelson is a genius at making people throw their money away on gambling. Don"t pretend that"s just slot machines. He gets them to throw it away by inflating his stock.

Don"t bet too hard on Macau. LVS had better do GANGBUSTERS or it"s going to become a massive bursting bubble.

Not to mention, it"s your largest position, so you"ve got way too many eggs in that basket. You really should go ahead and sell at minimum half of your position in LVS... the ride may keep up for a bit, but you"re going to get burned eventually if you get greedy on a 1800% return.
I don"t disagree with anything you"ve said there. I"ve sold a few times during the runup and this is just what"s left of the portfolio. Like I said before this is just fun money. I have a separate account with mutual funds in it with the majority of my money.
 

Elerion

N00b
735
46
FulorianC said:
Also, you can discount 4 billion of that common shareholders equity, since that was created by two shareholder issuances to none other than Sheldon. That was an imaginary growth in the common equity. In reality, common equity is 2 billion. So really, you"re trading at 15x book.
In what world does this make sense? You don"t discount majority shareholders when calculating book equity. How is it "imaginary"?

I admit I don"t know the first thing about the company in question, just calling you out on that statement.
 

Fulorian

Golden Knight of the Realm
104
46
Sorry, I expressed it badly. When discussing LVS with others, I"ve seen people point in the growth in equity from 2 billion to 6 billion over the last two years, as though that was a significant impact from return on equity. I was trying to express that the growth was imaginary, because it was from share issuance to the CEO/Chairman.

Let me put it this way. That $4 billion is "available" to common shareholders... at liquidation. It"s capital that contributes to the company. In that respect, it"s real. But it"s not real growth in the underlying equity, even though it"s sometimes touted as such. It might as well be debt, rather than equity, for purposes of analyzing book value and its growth.
 

Elerion

N00b
735
46
So then you"ll agree that the statement "So really, you"re trading at 15x book" makes no sense?

You need to find some better people to discuss finance with if they"re confusing retained earnings and injected capital, though. Lets hope these guys aren"t in your CFA class.
 

Eomer

Trakanon Raider
5,472
272
Since a couple people have put their money where their mouths are, I"ll post a couple screens of my RRSP. Not sure what the American equivalent is, but basically it"s a registered account where you can make contributions (18% of income up to a max of around 23k for 2010 I believe) that are deductible from income, and then they grow tax free until you remove cash from the account, when it will be taxed as income. I"ve also got a TFSA which is basically the same thing but the annual contribution limit is 5k (indexed to inflation), and contributions aren"t deductible. The TFSA is strictly the iShares CDN index. I also have a non-registered account that largely mirrors the RRSP, but is about 2-3 times as large.

I largely started from scratch in 2009 with the RRSP. I sold the various mutual funds (some index, some not) that I had owned up to that point in late May, and then as you can see jumped back in after reading up a bit on index investing in July. Unfortunately I likely missed a fair amount of the rebound because of it. From this point on, I intend on continuing to invest in my RRSP, TFSA, and non-registered accounts in much the same way, and am resisting the urge to trade actively.

The RRSP account is up about 18.5% since I re-invested (including dividends that I"ve plowed back in when it makes sense to do so, fee wise), which isn"t anything to be too proud of given the stock market the past couple years, but I"ve invested virtually zero thought, time or effort in to it since reinvesting. Also, the Canadian dollar"s risen by 15-25% against the US dollar, so a good portion of my portfolio"s returns have been cannibalized by that.

Specifically with the RRSP, I won"t be touching that money for decades at least, so I"m more or less content thinking about it as little as possible and hoping that I get the historical return of somewhere around 6.5-7.5% a year over the long term, while minimizing fees as much as possible. I looked in to an active portfolio manager, and it seems like pretty much all of them charge 1-2% of your portfolio value, which doesn"t really interest me given that they"re unlikely to even match index/benchmark returns.

edit: and yes, at some point I"ll add bond exposure, I just haven"t gotten around to educating myself a bit on bonds and bond funds.
 

rinthea_foh

shitlord
0
0
Eomer said:
edit: and yes, at some point I"ll add bond exposure, I just haven"t gotten around to educating myself a bit on bonds and bond funds.
dude dont bother, just sit back and be happy with the 10% annual returns with a 20% standard deviation from stocks, over decades bonds will underperform.

and don"t get to cocky and think your brilliant when you"re doing better than average, and don"t get too pessimistic when the sky is falling in.

and don"t overtrade, it"s a waste of money paying retail commisions, not to mention you"ll probably fuck up the timing and lose




I have to get a quote in here from prescient63
"Think of TA as poor man"s quant analysis", I"d change that to,
"Think of quant analysis as exactly the same as TA, but the quantsthinkthey"re smarter".

To the OP"s question. I"ll Ignore the obvious warnings about TA and all prediction techniques used on financial markets.

There"s heaps of software and data available. It all depends on how much you want to pay. And like anything, you get what you pay for. I"ve used many, many different services. If you"re more specific about what you want and if your prepared to pay, than I could reccommend something appropriate. Perhaps try tradestation as a broker. Last time I checked if you opened an account with them you could use their testing/TA software. Genesis is also good. Both are user friendly and have everything under the sun already programmed in.
 

Shonuff

Mr. Poopybutthole
5,538
790
rinthea said:
I have to get a quote in here from prescient63
"Think of TA as poor man"s quant analysis", I"d change that to,
"Think of quant analysis as exactly the same as TA, but the quantsthinkthey"re smarter".
I"d love to see the hard data on that, by reliable sources. Every thing that"s been presented to me by a prof or a mutual fund manager says that quant > TA (with TA having some benefit once you"ve done your quant work).

I"d like to see some good research that says you don"t need to know the balance sheet, income statement, or even the future prospects, and that knowing the candlestick > all.
 

rinthea_foh

shitlord
0
0
Quant analysis isn"t balance sheet stuff. It"s programming T/A and charting into a robot and getting it to trade for you. What you"re talking about with balance sheets is fundamental analysis.

There"s no hard data in finance. There"s only people who make money and those who don"t. And the ones taht make money don"t tell you how. Especially if they"re making it from being right (rather than tax and political advantages, ahem famous FA investor buffet).

Big markets are very efficient and if something is fundamentally bad, its price will be bad. If something is fundamentally good and it"s price is bad. Most likely something else is bad with it that doesnt show up in the fundamental analysis. The trick is finding something that everyone doesn"t know and hoping the market sees it before what you find becomes irrelevant or you go broke.
 

Big Phoenix

Pronouns: zie/zhem/zer
<Gold Donor>
44,370
92,518
Whats the benefit of investing in mutual funds over individual stocks if one actually takes a bit of time to research companies and track their monies? Are mutual more for guys who just like to throw their money into the market and not look after it?
 

Elerion

N00b
735
46
Grats, you hit on your dice rolls!

If you"re not trolling: Mutual funds and ETFs provide diversification cheaper than small time investors can otherwise obtain it, and some degree of management (at the very least some rebalancing).

Just "researching companies and tracking their monies" doesn"t result in the guaranteed returns you think it does. It is statistically unproven that active stock picking leads to excess returns over time. I firmly believe it is possible, but it requires a shit ton of work, and is probably aided by information that people like me have available minutes/hours/days before people like you.
 

astos_sl

shitlord
8
0
prescient63 said:
My fake portfolio kills the market, and it"s all buy and hold. I"ve been trading this fake portfolio since mid 2006. I need a life.

Alpha 9.78%
Beta .27
Rsquared .35

Honestly though my timing is pretty killer hahaha.

Edit: Fuck Energizer, I overweighted or i guess optimally (risk return adjusted) weighted it in my portfolio the day before it dropped off the goddamn map. I need to dump that dog.

Edit 2: While I"m thinking about it, I"ve been thumbing through the Handbook of Portfolio Mathematics - Formulas for Optimal Allocation and Leverage and I think that is a pretty solid book. You"re going to need a little stats knowledge to read it though. Don"t let that scare you though it isn"t really quant heavy. If you can handle correlation, covariance, and z-scores I think you would be fine, and the author seems to walk you through many of the examples but I pretty much just skipped to the sections I was interested in.
What software is that in the pics? I like the graph layout and the historical returns of your portfolio vs s&p 500
 

prescient

Silver Knight of the Realm
97
5
Astos said:
What software is that in the pics? I like the graph layout and the historical returns of your portfolio vs s&p 500
It"s just the web layout used through Marketocracy. You could probably do the same thing with excel really quickly.
 

astos_sl

shitlord
8
0
prescient63 said:
It"s just the web layout used through Marketocracy. You could probably do the same thing with excel really quickly.
Thanks. Yeah I could do the graph quickly with excel, but I like how it showed the historical returns vs. sp500 the most.
 

Tuco

I got Tuco'd!
<Gold Donor>
45,320
73,377
Just finished the first revision of the software I"m creating.

The overall idea hasn"t changed much from what I asked for in the original post.

The software allows the user to:

1. Load any symbol"s history and display it in a chart.

2. Select from a list of analyses to run on the loaded symbol.

3. Calibrate each analysis with different parameters.

4. Display the buy/sell signals or other graphic output of each analysis.

Additionally, I didn"t mention this yet but I added the ability to:

5. Run a simulation using a set of symbols and a set of analyses" buy/sell signals to see the performance of the analyses.

At some later revision I"d like to add:

6. A "Calibrator" that runs many simulations with different analyses/parameters to find the best performing set in a given time period for a given set of symbols.

It works pretty well. It"s extremely fast (It stores all the information using SQL, so only pulls data from yahoo the first time) and has a very customizable display for the data. I"ve attached a screenshot that shows what it looks like.

Now that I"ve completed the full circle of desired features, the next revision will be primarily adding more analyses, which was the original purpose of the project.

Some of the big challenges of the project at this point are:

A. There is an enormous amount of work to do in order to add all the analyses I"ve learned to the application, but that"s not unexpected and should be pretty fun as programming goes.

B. The charting software I"m using is a bit of a pain and has some inefficiencies, but improving the look is a complete waste of time really. You can see how strongly I feel about that by how shoddy the UI is. I"m incrementally refactoring the charting software by stripping out unnecessary features and adding ones I need, but anything I need to do takes a while. The software itself is good, but just isn"t what I need. I have the feeling that I"ll end up rolling my own charting software which will take a lot of time.

C. Even if one can generate a set of buy/sell signals with reasonable confidence values, what to do with them is an entirely separate issue of trading that I"m not well versed in and am not focusing on. The lack of good trading strategy hampers my ability to see how the analyses perform, but ultimately it shouldn"t be a huge detriment.

D. Once one has a confident buy/sell signal, simulating the transaction process is inaccurate. Currently I have a "delay" in days between the decision to transact and the transaction itself. Once the decision to transact is made, the actual transaction occurs X days after. I could play around with deviance using the open/high/low/volume values, but I"m just guessing at that point. I"ll need to study more on how a small purchase of stock would transact with some broker, but since most of the purchases I"m doing are on fairly long-term, the transaction discrepancies shouldn"t be major.

For the screenshot, you can see from the screenshot that I analyzed Ford"s stock for last year, and simulated the buying and selling of that stock using a single 10 day moving average. The selection of Ford"s last year was more or less random. You"ll notice that I start with $10,000 and end up with $14,124, but if I had just invested all $10,000 at the start and kept it in, I would"ve ended up with over $16,000. I could"ve hunted for a year/symbol that my simple analysis would"ve beaten the market, but I think it"s important not to be pretentious. I don"t believe I"ve got anything that can predict the stock market at this point, but I"ve got a lot of work to do to add the rest of the analyses. Once I do I think I"ll have a good method to determine the value of technical analysis.

If anyone has any questions, ideas to incorporate or has some unmentioned in this thread software that does this type of work, feel free to post it.
 

prescient

Silver Knight of the Realm
97
5
Tuco said:
Stuff

If anyone has any questions, ideas to incorporate or has some unmentioned in this thread software that does this type of work, feel free to post it.
Looks awesome! I would think that one thing you might want to do is run arbitrage analysis against a set of stocks. You can determine whether stocks are related by industry programatically by pulling their GICS codes (to some extent, and lacking access to gics codes you could generate a flat file fromFINVIZ.com - Stock Screenerstock screener). From there you could load up the data sets and start batch running them to look for highly correlated stocks looking for arbitrage plays. All in all it isn"t too bad it"s just that your data set ends up getting retardedly huge. This book will give you a rundown of what I"m thinking (basically pairs trading). It might not be your thing but I"ll throw it out there anyhow.Amazon.com: Pairs Trading: Quantitative Methods and Analysis (Wiley Finance) (9780471460671): Ganapathy Vidyamurthy: Books.

In testing your strategies (supposing you wanted to focus on ford) you should probably only be looking at a certain period of time and leaving yourself some room to test the strategy. IE figure something out given months 1-6 and then test on months 7-12. That way you are testing blind.

Most of this you probably have figured out, but those are the thoughts I had since seeing it.

Not to dissuade your development because it looks like it"s going along swimmingly but almost everything you have implemented can be done in matlab super quick (ie out of the box). You might want to take a look there and it would allow you to speed up development really quickly.

This is a 1hr tutorial they had on algorithmic trading. You have to sign up to view it but i don"t recall getting spammed by them. If nothing else its a good video/tutorial to watch and you can get some ideas of what people are doing with this type of thing as well as how it"s being implemented.

Algorithmic Trading with MATLAB: What"s New for 2009 - MATLAB Webinar

You may might also want to look at some time series analysis books. This book is apparently the fucking bible of time series analysis but it"s over my headAmazon.com: Analysis of Financial Time Series (Wiley Series in Probability and Statistics) (9780471690740): Ruey S. Tsay: Books

Last thought look at ETF"s for arbitrage opportunities.

All in all kick ass job!

Edit: how are you determining your buy and sell signals?at most points it looks like its just above Moving average = buy below = sell? but it doesnt look that way in the beginning (or say apr 15). Additionally, I"m not really thrilled with your layout but that"s a minor thing. The strange thing is that almost every trading application is layed out similarly (reuters station, esignal, thomson one to some degree). Of all of them I"ve liked the Thomson One layout the best you might give that a look.

I"ve linked some screenshots. Have Fun!
Spoiler Alert, click show to read:

ThomsonOne.jpg


mscfinthomsonmarketslarge.jpg
 

Tuco

I got Tuco'd!
<Gold Donor>
45,320
73,377
Thanks for the tips.

I"ve looked a little into arbitrage but I don"t think I could trade at the right timing constraints to take advantage of it. Right now I"m focusing more on purchase decisions that last for weeks or months.

I had thought about using MATLAB (Used it in the past) but decided against it for various reasons. I"ll check out that webinar anyway.

Don"t look too deeply into my buy/sell signals in my screenshot. Most of the work I"ve done is creating the infrastructure to support the analysis, not the analysis itself. Overall it"s probably 5000-10000 lines of code. Around 30 of which has to do with generating a buy/sell signal from the moving average. To answer your question, if the MA(moving average) crosses to the positive side (yesterday was below MA, today is above) it will generate a buy signal. There"s an option to only generate the signal once the MA becomes positive. It"s just a cheap signal I put in to test the rest of the system.

For the layout, I"ve kept it fairly loose and unstructured. It"d be more typical (from the trading programs I"ve seen they do this) to use an MDI (Multiple Document Interface, where you have one main window and a bunch of child windows. Photoshop uses this) and have all the windows inside it, but I kept it loose with a bunch of floating windows because I like that better personally.

I had thought of using a bar chart instead of a line plot to show the movement, and I probably will in the future, but dealing with the charting software is a timesink.

I"ll probably look into some of those books in the future.
 

Tuco

I got Tuco'd!
<Gold Donor>
45,320
73,377
Wrapped up another block of work. This time it was 100% focused on adding more types of analyses to the system. I started out with the easy ones and so far have:

Moving Average (Simple, Exponential and Weighted)
Double Crossover
Triple Crossover
Envelope (Percentage based, High/Low and Bollinger)
Oscillator (Time Period, Commodity Channel Index, Relative Strength Index)
Moving Average Difference
Stochastics
Moving Average Convergence/Divergence (MACD)

These are the names that are in the book I"m reading.

I intended to go further with this version, and add trend detection systems, support/resistence detection and flags/pennants/triangles and finally head and shoulders but as I"m incorporating more advanced calculations in my analyses it"s become more difficult to guarantee the correctness of the code. Currently I"m largely just eyeballing the graphs the systems make, but deviations of a missing or extra day are easy to let slip by.

I"ve been looking at some existing systems and as I"ve been integrating these analyses I"m becoming increasingly less respectful of the existing applications that do this. Their configurability is very low and none that I"ve seen have even attempted the end of goal of this software.

I"m going to stop here and integrate a suite of automated unit tests to verify the correctness of the mathematics of what I"m doing. This might have to wait though because I will probably do a great deal of re-factoring of the code to layout the analyses in a much more re-usable and sleeker way, and don"t want to have to re-factor the unit tests after this. One of the problems I"m having is that it"s difficult to create re-usable code that integrates well with the property window (The interesting part of the Analysis Selector in the screenshot above). It wouldn"t be a problem if C# supported multiple-inheritance but alas it doesn"t. That"s all boring software engineer shit though.

The unit testing for the existing analyses shouldn"t take long (Though more frequent breaks will be needed). I have high hopes for the un-incorporated analyses. The results determined by the existing analyses I have are less than satisfactory and don"t produce good results.
 

Hebbin_foh

shitlord
0
0
Be sure to take broker fees/fills/taxes into account with your model. Buying whenever a stock goes above an exponential moving average and selling whenever it goes below looks great in theory but doesn"t always work as well in practice.