Stock trading models that use fundamental analysis, e.g. PEG ratios?
"One idea: If you came up with a model to calculate a ""fair price range"" for a stock, then any time the market price were to go below the range it could be a buy signal, and above the range it could be a sell signal. There are many ways to do stock valuation using fundamental analysis tools and ratios: dividend discount model, PEG, etc. See Wikipedia - Stock valuation. And while many of the inputs to such a ""fair price range"" calculation might only change once per quarter, market prices and peer/sector statistics move more frequently or at different times and could generate signals to buy/sell the stock even if its own inputs to the calculation remain static over the period. For multinationals that have a lot of assets and income denominated in other currencies, foreign exchange rates provide another set of interesting inputs. I also think it's important to recognize that with fundamental analysis, there will be extended periods when there are no buy signals for a stock, because the stocks of many popular, profitable companies never go ""on sale"", except perhaps during a panic. Moreover, during a bull market and especially during a bubble, there may be very few stocks worth buying. Fundamental analysis is designed to prevent one from overpaying for a stock, so even if there is interesting volume and price movement for the stock, there should still be no signal if that action happens well beyond the stock's fair price. (Otherwise, it isn't fundamental analysis — it's technical analysis.) Whereas technical analysis can, by definition, generate far more signals because it largely ignores the fundamentals, which can make even an overvalued stock's movement interesting enough to generate signals." "Maria, there are a few questions I think you must consider when considering this problem. Do fundamental or technical strategies provide meaningful information? Are the signals they produce actionable? In my experience, and many quantitative traders will probably say similar things, technical analysis is unlikely to provide anything meaningful. Of course you may find phenomena when looking back on data and a particular indicator, but this is often after the fact. One cannot action-ably trade these observations. On the other hand, it does seem that fundamentals can play a crucial role in the overall (typically long run) dynamics of stock movement. Here are two examples, Technical: suppose we follow stock X and buy every time the price crosses above the 30 day moving average. There is one obvious issue with this strategy - why does this signal have significance? If the method is designed arbitrarily then the answer is that it does not have significance. Moreover, much of the research supports that stocks move close to a geometric brownian motion with jumps. This supports the implication that the system is meaningless - if the probability of up or down is always close to 50/50 then why would an average based on the price be predictive? Fundamental: Suppose we buy stocks with the best P/E ratios (defined by some cutoff). This makes sense from a logical perspective and may have some long run merit. However, there is always a chance that an internal blowup or some macro event creates a large loss.  A blended approach: for sake of balance perhaps we consider fundamentals as a good long-term indication of growth (what quants might call drift). We then restrict ourselves to equities in a particular index - say the S&P500. We compare the growth of these stocks vs. their P/E ratios and possibly do some regression. A natural strategy would be to sell those which have exceeded the expected return given the P/E ratio and buy those which have underperformed. Since all equities we are considering are in the same index, they are most likely somewhat correlated (especially when traded in baskets). If we sell 10 equities that are deemed ""too high"" and buy 10 which are ""too low"" we will be taking a neutral position and betting on convergence of the spread to the market average growth. We have this constructed a hedged position using a fundamental metric (and some helpful statistics). This method can be categorized as a type of index arbitrage and is done (roughly) in a similar fashion. If you dig through some data (yahoo finance is great) over the past 5 years on just the S&P500 I'm sure you'll find plenty of signals (and perhaps profitable if you calibrate with specific numbers). Sorry for the long and rambling style but I wanted to hit a few key points and show a clever methods of using fundamentals."
"A couple options that I know of: Interactive Brokers offers a ""paper trading"" mode to its account holders that allows you to start with a pretend stack of money and place simulated trades to test trading ideas. They also provide an API that allows you to interface with their platform programmatically for retrieving quotes, placing orders, and the such. As you noted, however, it's not free; you must hold a funded brokerage account in order to qualify for access to their platform. In order to maintain an account, there are minimums for required equity and monthly activity (measured in dollars that you spend on commissions), so you won't get access to their platform without having a decent amount of skin in the game. IB's native API is Java-based; IbPy is an unofficial wrapper that makes the interface available in Python. I've not used IB at all myself, but I've heard good things about their API and its accessibility via IbPy. Edit: IB now supports Python natively via their published API, so using IbPy is no longer needed, unless you wish to use Python 2.x. The officially supported API is based on Python 3. TD Ameritrade also offers an API that is usable by its brokerage clients. They do not offer any such ""paper trading"" mode, so you would need to ""execute"" transactions based on quotes at the corresponding trade times and then keep track of your simulated account history yourself. The API supports quote retrieval, price history, and trade execution, among other functions. TDA might be more attractive than IB if you're looking for a low-cost link into market data, as I believe their minimum-equity levels are lower. To get access, you'll need to sign up for an API developer account, which I believe requires an NDA. I don't believe there is an official Python implementation of the API, but if you're a capable Python writer, you shouldn't have trouble hooking up to the published interfaces. Some caveats: as when doing any strategy backtesting, you'll want to be sure to be pessimistic when doing so, so your optimism doesn't make your trades look more successful than they would be in the real world. At a minimum, you'll want to ensure that your simulations transact at the posted bid/ask prices, not necessarily the last trade's price, as well as any commissions and fees associated with the trade. A more robust scheme would also take into account the depth of the order book (also known as level 2 quotes), which can cause additional slippage in the prices at which you buy/sell your security. An even more robust scheme would take into account the potential latency of trade execution, looking at all prices over some time period that covers the maximum expected latency and simulating the trade at the worst-possible price." The Sharpe ratio is, perhaps, the method you are looking for.  That said, not really sure beta is a meaningful metric, as there are plenty of safe bets to be made on volatile stocks (and, conversely, unsafe bets to be made on non-volatile ones). Just got back from the office, so I can better answer it now. The trader uses the Metatrader platform, which is programmed with a language based off C++. I'm working with him to update some algos now. His strategies running on ToS are more or less proof-of-concept that he streams right now as he sources investors. Are you implying that Amazon is a better investment than GE because Amazon's P/E is 175 while GE's is only 27?  Or that GE is a better investment than Apple because Apple's P/E is just 13.  There are a lot of other ratios to consider than P/E.  I personally view high P/E numbers as a red flag.  One way to think of a P/E ratio is the number of years it's expected for the company to earn its market cap.  (Share price divided by annual earnings per share)  It will take Amazon 175 years to earn $353 billion. If I was going to buy a dry cleaners, I would not pay the owner 175 years of earnings to take control of it, I'd never see my investment back. To your point.  There is so much future growth seemingly built in to today's stock market that even when a company posts higher than expected earnings, the company's stock may take a hit because maybe future prospects are a little less bright than everyone thought yesterday. The point of fundamental analysis is that you want to look at a company's management style and financial strategies.  How is it paying its debt?  How is it accumulating the debt?  How is it's return on assets?  How is the return on assets trending?  This way when you look at a few companies in the same market segment you may have a better shot at picking the winner over time.  The company that piles on new debt for every new project is likely to continue that path in to oblivion, regardless of the P/E ratio. (or some other equally less forward thinking management practice that you uncover in your fundamental analysis efforts). And I'll add... No amount of historical good decision making from a company's management can prepare for a total market downturn, or lack of investor confidence in general.  The market is the market; sometimes it's up irrationally, sometimes it's down irrationally. Another one I have seen mentioned used is Equity Feed. It had varies levels of the software depending on the markets you want and can provide level 2 quotes if select that option. http://stockcharts.com/ is also a great tool I see mentioned with lots of free stuff. "Strategy would be my top factor.  While this may be implied, I do think it helps to have an idea of what is causing the buy and sell signals in speculating as I'd rather follow a strategy than try to figure things out completely from scratch that doesn't quite make sense to me. There are generally a couple of different schools of analysis that may be worth passing along: Fundamental Analysis:Fundamental analysis of a business involves analyzing its financial statements and health, its management and competitive advantages, and its competitors and markets. When applied to futures and forex, it focuses on the overall state of the economy, interest rates, production, earnings, and management. When analyzing a stock, futures contract, or currency using fundamental analysis there are two basic approaches one can use; bottom up analysis and top down analysis. The term is used to distinguish such analysis from other types of investment analysis, such as quantitative analysis and technical analysis. Technical Analysis:In finance, technical analysis is a security analysis methodology for forecasting the direction of prices through the study of past market data, primarily price and volume. Behavioral economics and quantitative analysis use many of the same tools of technical analysis, which, being an aspect of active management, stands in contradiction to much of modern portfolio theory. The efficacy of both technical and fundamental analysis is disputed by the efficient-market hypothesis which states that stock market prices are essentially unpredictable. There are tools like ""Stock Screeners"" that will let you filter based on various criteria to use each analysis in a mix.  There are various strategies one could use.  Wikipedia under Stock Speculator lists: ""Several different types of stock trading strategies or approaches exist including day trading, trend following, market making, scalping (trading), momentum trading, trading the news, and arbitrage.""  Thus, I'd advise research what approach are you wanting to use as the ""Make it up as we go along losing real money all the way"" wouldn't be my suggested approach. There is something to be said for there being numerous columnists and newsletter peddlers if you want other ideas but I would suggest having a strategy before putting one's toe in the water." "I agree completely.  ""I don't always agree with John Cochrane, but when I do, I agree completely.""  I think heavy reliance on either approach to pricing is generally a bad idea.  Equilibrium models always include something that you're supposed to inherently know, but never do.  No-arbitrage models don't necessarily *say* anything that you don't (in some mathematical sense) already know.  So you're either stuck with unknown parameters, or you can't explain why you're something is worth what you say it is beyond, ""Herp derp, other people are doing it.""  So I think if buy-side people made some use of no-arbitrage models, they'd have a better understanding of the parameters they're making up, and if sell-side people sometimes used equilibrium models, they'd have a better grasp of what's going on economically.  Also, it would have the beneficial effect of reminding people that their models are always wrong, even if they're frequently useful." "duffbeer's answers are reasonable for the specific question asked, but it seems to me the questioner is really wanting to know what stocks should I buy, by asking ""do you simply listen to 'experts' and hope they are right?"" Basic fundamental analysis techniques like picking stocks with a low PE or high dividend yield are probably unlikely to give returns much above the average market because many other people are applying the same well-known techniques." "As other people have posted starting with ""fictional money"" is the best way to test a strategy, learn about the platform you are using, etc. That being said I would about how Fundamental Analysis works . Fundamental Analysis is the very basis of learning about an assets true value is priced. However in my humble opinion, I personally just stick with Index funds. In layman's terms Index Funds are essentially computer programs that buy or sell the underlying assets based on the Index they are associated with in the portion of the underlying index. Therefore you will usually be doing as good or as bad as the market. I personally have the background, education, and skillsets to build very complex models to do fundamental analysis but even I invest primarily in index funds because a well made and well researched stock model could take 8 hours or more and Modern Portfolio Theory would suggest that most investors will inevitably have a regression to the mean and have gains equal to the market rate or return over time. Which is what an index fund already does but without the hours of work and transaction cost." Fundamental Analysis can be used to help you determine what to buy, but they won't give you an entry signal for when to buy. Technical Analysis can be used to help you determine when to buy, and can give you entry signals for when to buy. There are many Technical Indicator which can be used as an entry signal, from as simple as the price crossing above a moving average line and then selling when the price crosses back below the moving average line, to as complicated as using a combination of indicators to all line up for an entry signal to be valid. You need to find the entry signals that would suit your investing or trading and incorporate them as part of your trading plan. If you want to learn more about entry signals you are better off learning more about Technical Analysis. Yes, exactly. VaR is just a single tailed confidence interval.  To go from model to strategy, you need to design some kind of indicator (i.e. when to buy and when to short or stay out). In practice, this will look like a large matrix with values ranging from -1 to 1 (corresponding to shorting and holding respectively) for each security and each day (or hour, or minute, or tick, etc.), which you then just multiply with the matrix of the stock returns. The resulting matrix will be your daily returns for each stock, you can then just row sum for daily returns of a portfolio, or calculate a cumulative product for cumulative returns.  A simple example of an indicator would be something like a value of 1 when the price of the stock is below the 30 day moving average, and 0 otherwise. You can use a battery of econometric models to design these indicators, but the rest of the strategy design is essentially the same, and it's *relatively* easy to build a one-size-fits-all back-testing code.  I'll try to edit this post later and link a blog that goes through some of the code.  Edit: [Here](http://www.signalplot.com/simple-machine-learning-model-trade-spy/) is a post that discusses implementing a simple ML strategy. You can ignore most of the content but if you go through the github, you'll see how the ML model is implemented as a strategy.  An even easier example can be found from [the github connected to this post](http://www.signalplot.com/how-to-measure-the-performance-of-a-trading-strategy/), where the author is just using a totally arbitrary signal. As you can see, deriving a signal can be a ton of work, but once you have, actually simulating the strategy can be done in just a few lines of code.  Hopefully the author won't mind me linking his page here, but I find his coding style to be very clean and good for educational purposes. "ycharts.com has ""Weighted Average PE Ratio"" and a bunch of other metrics that are meant to correspond to well known stock metrics.  Other websites will have similar ratios." He means [Technical Analysis](http://en.wikipedia.org/wiki/Technical_analysis).  It can really be simple. Even just trading on the RSI is a way to make money.   To learn it, I'd suggest reading wikipedia and messing around with a trading platform- there's one I use at work which is quite user-friendly, I'll PM you if you're interested. Don't really want to be spouting employer information on reddit. I assert not so. Even if we assume a zero sum game (which is highly in doubt); the general stock market curves indicate the average player is so bad that you don't have to be very good to have better that 50/50 averages. One example: UP stock nosedived right after some political mess in Russia two years ago. Buy! Profit: half my money in a month. I knew that nosedive was senseless as UP doesn't have to care much about what goes on in Russia. Rising oil price was a reasonable prediction; however this is good for railroads, and most short-term market trends behave as if it is bad. all of these examples are great if you actually believe in fundamentals, but who believes in fundamentals alone any more? Stock prices are driven by earnings, news, and public perception. For instance, a pharma company named Eyetech has their new macular degeneration drug approved by the FDA, and yet their stock price plummeted. Typically when a small pharma company gets a drug approved, it's off to the races. But, Genetech came out said their macular degeneration drug was going to be far more effective, and that they were well on track for approval.