How's the graph of after/pre markets be drawn?
Graphs are nothing but a representation of data. Every time a trade is made, a point is plotted on the graph. After points are plotted, they are joined in order to represent the data in a graphical format.  Think about it this way.  1.) Walmart shuts at 12 AM. 2.)Walmart is selling almonds at $10 a pound.  3.) Walmart says that the price is going to reduce to $9 effective tomorrow. 4.) You are inside the store buying almonds at 11:59 PM.  5.) Till you make your way up to the counter, it is already 12:01 AM, so the store is technically shut. 6.) However, they allow you to purchase the almonds since you were already in there.  7.) You purchase the almonds at $9 since the day has changed. 8.) So you have made a trade and it will reflect as a point on the graph. 9.) When those points are joined, the curves on the graph will be created. 10.) The data source is Walmart's system as it reflects the sale to you. ( In your case the NYSE exchange records this trade made). Buying a stock is just like buying almonds. There has to be a buyer. There has to be a seller. There has to be a price to which both agree. As soon as all these conditions are met, and the trade is made, it is reflected on the graph. The only difference between the graphs from 9 AM-4 PM, and 4 PM-9 AM is the time. The trade has happened regardless and NYSE(Or any other stock exchange) has recorded it! The graph is just made from that data. Cheers. the data source is the same as the live market trading. pre and after market trading are active markets and there are actual buyers and sellers getting their orders matched.
I ended up writing a simulation in R. Here is my code: It produces a plot like this:  This code assumes you have a lump sum and either wish to pay down a loan or invest it all immediately. Feedback welcome. The Level 2 data is simply showing the depth of the market. If I am trading shares with my broker I have the option of viewing only the top 10 bid/ask prices in the depth or all of the data (which sometimes can be a very long list). With another broker I get the top ten bid and ask prices and how many orders are available for each price level, or I have the option of listing each order separately for each price level (in order of when the order was placed). I get the same kind of data if trading options. I do not know about futures because I don't trade them. Simply this data may be important to a trader because it may give an indication of whether there are more buyers or sellers in the market, which in turn may (but not always) give an indication of which way the market may be moving. As an example the price depth below shows WBC before market open with sellers outweighing the buyers in both numbers and volume.  This gives an indication that prices may drop when the market opens. Of course there could be some good news coming out prior to market open or just after, causing a flood of buyers into the market and sellers to cancel their orders. This would change everything around with more buyers than sellers and indicate that prices may now be going up. The market depth is an important aspect to look at before putting an order in, as it can give an indication of which way the market is moving, especially in a very liquid security or market. "From what I have read from O'Neil to Van Tharp, etc, etc, no one can pick winners more than 75% of the time regardless of the system they use and most traders consider themselves successful if 60% of the trades are winners and 40% are losers.  So I am on the side that the chart is only a reflection of the past and cannot tell you reliably what will happen in the future. It is difficult to realize this but here is a simple way for you to realize it. If you look at a daily chart and let's say it is 9:30 am at the open and you ask a person to look at the technical indicators, look at the fundamentals and decide the direction of the market by drawing the graph, just for the next hour. He will realize in just a few seconds that he will say to him or her self ""How on earth do you expect me to be able to do that?""  He will realize very quickly that it is impossible to tell the direction of the market and he realizes it would be foolhardy to even try. Because Mickey Mantle hit over 250 every year of his career for the first 15 years it would be a prudent bet to bet that he could do it again over the span of a season, but you would be a fool to try to  guess if the next pitch would be a ball or a strike. You would be correct about 50% of the time and wrong about 50% of the time. You can rely on LARGER PATTERNS OF BEHAVIOR OVER YEARS, but short hourly or even minute by minute prediction is foolish. That is why to be a trader you have to keep on trading and if you keep on trading and cut your losses to 1/2 of your wins you will eventually have a wonderful profit.  But you have to limit your risk on any one trade to 1% of your portfolio.  In that way you will be able to trade at least 100 times.  do the math.  trade a hundred times.  lose 5% and the next bet gain 10%.  Keep on doing it. You will have losses sometimes of 3 or 4 in a row and also wins sometimes of 3 or 4 in a row but overall if you keep on trading even the best traders are generally only ""right"" 60% of the time.  So lets do the math. If you took 100 dollars and make 100 trades and the first trade you made 10% and reinvested the total and the second trade you lost 5% of that and continue that win/loss sequence for 100 trades you would have 1284 dollars minus commissions. That is a 1200% return in one hundred trades.  If you do it in a roth IRA you pay no taxes on the short term gains.  It is not difficult to realize that the stock market DOES TREND. And the easiest way to make 10% quickly is to in general trade 3x leveraged funds or stocks that have at least 3 beta from the general index.  Take any trend up and count the number of days the stock is up and it is usually 66-75% and take any down trend and it is down 66-75% of the days.  So if you bet on the the beginning of a day when the stock was up and if you buy the next day about 66-75% of the time the stock will also be up. So the idea is to realize that 1/3 of the time at least you will cut your losses but 2/3 of the time you will be up then next day as well.  So keep holding the position based on the low of the previous day and as the stock rises to your trend line then tighten the stock to the low of the same day or just take your profit and buy something else.  But losing 1/3 times is just part of ""the unpredictable"" nature of the stock market which is causes simply because there are three types of traders all betting at the same time on the same stock.  Day traders who are trading from 1 to 10 times a day, swing traders trading from 1 day to several weeks and buy and hold investors holding out for long term capital gains. They each have different price targets and time horizons and THAT DIFFERENCE is what makes the market move.  ONE PERSON'S SHORT TERM EXIT PRICE AT A PROFIT IS ANOTHER PERSONS LONG TERM ENTRY POINT and because so many are playing at the same time with different time horizons, stop losses and exit targets it is impossible to draw the price action or volume.  But it is possible to cut your losses and ride your winners and if you keep on doing that you have a very fine return indeed." Specifically I'm trying to understand this pargraph:  &gt;Stripping the German mobile-phone unit of its cash and increasing its net debt before the IPO could help lower the unit’s average cost of capital, said Carlos Winzer, a senior vice president at Moody’s Investors Service.  &gt;“Telefonica Deutschland had a very strong cash position and no debt, so this move will allow the German unit to have a more efficient balance sheet structure,” said Winzer, who has covered Telefonica for 20 years  How does moving cash from the German unit to the Spanish Telefonica unit induce a more efficient balance sheet structure for the German unit?  Appreciate any help! "Using your example link, I found the corresponding chart for a stock that trades on London Stock Exchange: https://ca.finance.yahoo.com/echarts?s=RIO.L#symbol=RIO.L;range=1d As you can see there, the chart runs from ~8:00am to ~4:30pm, and as I write this post it is only 2:14pm Eastern Time.  So clearly this foreign chart is using a foreign time zone.  And as you can see from this Wikipedia page, those hours are exactly the London Stock Exchange's hours. Additionally, the closing price listed above the graph has a timestamp of ""11:35AM EST"", meaning that the rightmost timestamp in the graph (~4:30pm) is equal to 11:35AM EST.  16:30 - 11:30 = 5 hours = difference between London and New York at this time of year. So those are two data points showing that Yahoo uses the exchange's native time zone when displaying these charts." The curved lines (on my screen orange, yellow and pink) are simple moving averages.  The fuchsia and blue straight lines are automatically generated trend lines.  Those lines are attempting to show how a stock is trending by showing potential bounce points and are commonly used in technical analysis (TA). As others have pointed out, the value of Apple's stock and the NASDAQ are most likely highly correlated for a number of reasons, not least among them the fact that Apple is part of the NASDAQ. However, because numerous factors affect the entire market, or at least a significant subset of it, it makes sense to develop a strategy to remove all of these factors without resorting to use of an index. Using an index to remove the effect of these factors might be a good idea, but you run the risk of potentially introducing other factors that affect the index, but not Apple. I don't know what those would be, but it's a valid theoretical concern.  In your question, you said you wanted to subtract them from each other, and only see an Apple curve moving around a horizontal line. The basic strategy I plan to use is similar but even simpler. Instead of graphing Apple's stock price, we can plot the difference between its stock price on business day t and business day t-1, which gives us this graph, which is essentially what you're looking for:  While this is only the preliminaries, it should give you a basic idea of one procedure that's used extensively to do just what you're asking. I don't know of a website that will automatically give you such a metric, but you could download the price data and use Excel, Stata, etc. to analyze this.  The reasoning behind this methodology builds heavily on time series econometrics, which for the sake of simplicity I won't go into in great detail, but I'll provide a brief explanation to satisfy the curious. In simple econometrics, most time series are approximated by a mathematical process comprised of several components: In the simplest case, the equations for a time series containing one or more of the above components are of the form that taking the first difference (the procedure I used above) will leave only the random component. However, if you want to pursue this rigorously, you would first perform a set of tests to determine if these components exist and if differencing is the best procedure to remove those that are present. Once you've reduced the series to its random component, you can use that component to examine how the process underlying the stock price has changed over the years. In my example, I highlighted Steve Jobs' death on the chart because it's one factor that may have led to the increased standard deviation/volatility of Apple's stock price. Although charts are somewhat subjective, it appears that the volatility was already increasing before his death, which could reflect other factors or the increasing expectation that he wouldn't be running the company in the near future, for whatever reason. My discussion of time series decomposition and the definitions of various components relies heavily on Walter Ender's text Applied Econometric Time Series. If you're interested, simple mathematical representations and a few relevant graphs are found on pages 1-3. Another related procedure would be to take the logarithm of the quotient of the current day's price and the previous day's price. In Apple's case, doing so yields this graph:  This reduces the overall magnitude of the values and allows you to see potential outliers more clearly. This produces a similar effect to the difference taken above because the log of a quotient is the same as the difference of the logs The significant drop depicted during the year 2000 occurred between September 28th and September 29th, where the stock price dropped from 26.36 to 12.69. Apart from the general environment of the dot-com bubble bursting, I'm not sure why this occurred. Another excellent resource for time series econometrics is James Hamilton's book, Time Series Analysis. It's considered a classic in the field of econometrics, although similar to Enders' book, it's fairly advanced for most investors.  I used Stata to generate the graphs above with data from Yahoo! Finance: There are a couple of nuances in this code related to how I defined the time series and the presence of weekends, but they don't affect the overall concept. For a robust analysis, I would make a few quick tweaks that would make the graphs less appealing without more work, but would allow for more accurate econometrics. Assuming you were immersed in math with your CS degree, the book **'A Non-Random Walk Down Wall Street' by Andrew Lo** is a very interesting book about the random walk hypothesis and it's application to financial markets and how efficient markets might not necessarily imply complete randomness.    Lots of higher level concepts in the book but it's an interesting topic if you are trying to branch out into the quant world.  The book isn't very specific towards algorithmic trading but it's good for concept and ideas.  Especially for general finance, that will give you a good run down about markets and the way we tackle modern finance.    **A Random Walk Down Wall Street** (which the book above is named after) by **Burton Malkiel** is also supposed to be a good read and many have suggested reading it before the one I listed above, but there really isn't a need to do so.    For investing specifically, many mention **'The Intelligent Investor' by Benjamin Graham** who is the role model for the infamous Warren Buffet.  It's an older book and really dry and I think kind of out dated but mostly still relevant.  It's more specifically about individual trading rather than markets as a whole or general markets.  It sounds like you want to learn more about markets and finance rather than simply trading or buying stocks.  So I'd stick to the Andrew Lo book first.    ---  Also, since you might not know, it would be a good idea to understand the capital asset pricing model, free cash flow models, and maybe some dividend discount models, the last of which isn't so much relevant but good foundations for your finance knowledge.  They are models using various financial concepts (TVM is almost used in every case) and utilizing them in various ways to model certain concepts.  You'd most likely be immersed in many of these topics by reading a math-oriented Finance book.  Try to stay away from those penny stock trading books, I don't think I need to tell a math major (who is probably much smarter than I am) that you don't need to be engaging in penny stocks, but do your DD and come to a conclusion yourself if you'd like.  I'm not sure what career path you're trying to go down (personal trading, quant firm analyst, regular analyst, etc etc) but it sounds like you have the credentials to be doing quant trading.    ---  Check out www.quantopian.com.  It's a website with a python engine that has all the necessary libraries installed into the website which means you don't have to go through the trouble yourself (and yes, it is fucking trouble--you need a very outdated OS to run one of the libraries).  It has a lot of resources to get into algorithmic trading and you can begin coding immediately.  You'd need to learn a little bit of python to get into this but most of it will be using matplotlib, pandas, or some other library and its own personal syntax. Learning about alpha factors and the Pipeline API is also moderately difficult to get down but entirely possible within a short amount of dedicated time.     Also, if you want to get into algorithmic trading, check out Sentdex on youtube.  He's a python programmer who does a lot of videos on this very topic and has his own tool on quantopian called 'Sentiment Analyzer' (or something like that) which basically quantifies sentiment around any given security using web scrapers to scrape various news and media outlets.  Crazy cool stuff being developed over there and if you're good, you can even be partnered with investors at quantopian and share in profits.    You can also deploy your algorithms through the website onto various trading platforms such as Robinhood and another broker and run your algorithms yourself.    Lots of cool stuff being developed in the finance sector right now.  Modern corporate finance and investment knowledge is built on quite old theorems and insights so expect a lot of things to change in today's world.  ---  With a math degree, finance should be like algebra I back in the day.  You just gotta get familiar with all of the different rules and ideas and concepts.  There isn't that much difficult math until you begin getting into higher level finance and theory, which mostly deals with statistics anyways like covariance and regression and other statistic-related concepts.  Any other math is simple arithmetic. I like the graph! You can see both of the major recessions in the 1970's and the recovery in the 1980's. If you match that graph against the baby boomer population curve and you will see that while early baby boomers bought lots of houses, quite a few pushed into 1980's.  Also check out housing costs and you can see the soaring costs due to increasing demand. "haha I used to be the same way. But then I began to realize that these charts are somewhat intentionally vague so that the topic does seem more confusing and complicated, so then we're much more inclined to just say ""hmm ok, I guess they know what their talking about"".   That's the beauty of numbers too; they can be manipulated and concentrated into certain way so that it helps to prove a thesis someone is positing. Unfortunately these charts often provide zero context to go along with it, so any real knowledgable investor wont give much thought to one set of charts, like the ones in this post." the strategy is tested all the way to 97. how is the continuous series backadjusted? the emini is rolledover and Ratio back adjusted to the 2nd nearest contract, 9 days prior to expiration. since it is an intraday trade, the discrepancy to the real thing should be next to irrelevant. but comparing it to the spx could make it interesting.  what would be a good format to present the results ? jpeg? pdf ? Well i dont know of any calculator but you can do the following 1) Google S&P 500 chart 2) Find out whats the S&P index points (P1) on the first date 3) Find out whats the S&P index points (P2) on the second date 4) P1 - P2 = result "A lot of investors prefer to start jumping into tools and figuring out from there, but I've always said that you should learn the theory before you go around applying it, so you can understand its shortcomings.  A great starting point is Investopedia's Introduction to Technical Analysis. There you can read about the ""idea"" of technical analysis, how it compares to other strategies, what some of the big ideas are, and quite a bit about various chart patterns (cup and handle, flags, pennants, triangles, head & shoulders, etc). You'll also cover ideas like moving averages and trendlines. After that, Charting and Technical Analysis by Fred McAllen should be your next stop. The material in the book overlaps with what you've read on Investopedia, but McAllen's book is great for learning from examples and seeing the concepts applied in action. The book is for new comers and does a good job explaining how to utilize all these charts and patterns, and after finishing it, you should be ready to invest on your own.  If you make it this far, feel free to jump into Fidelity's tools now and start applying what you've learned. You always want to make the connection between theory and practice, so start  figuring out how you can use your new knowledge to generate good returns.  Eventually, you should read the excellent reference text Technical Analysis of the Financial Markets by John Murphy. This book is like a toolbox - Murphy covers almost all the major techniques of technical analysts and helps you intuitively understand the reasoning behind them. I'd like to quote a part of a review here to show my point:  What I   like about Mr. Murphy is his way of showing and proving a point. Let   me digress here to show you what I mean: Say you had a daughter and   wanted to show her how to figure out the area of an Isosceles   triangle. Well, you could tell her to memorize that it is   base*height/2. Or if you really wanted her to learn it thoroughly you   can show her how to draw a parallel line to the height, then join the   ends to make a nice rectangle. Then to compute the area of a rectangle   just multiply the two sides, one being the height, the other being   half the base. She will then ""derive"" this and   ""understand"" how they got the formula. You see, then she can   compute the area under a hexagon or a tetrahedron or any complex   object. Well, Mr. Murphy will show us the same way and   ""derive"" for us concepts such as how a resistance line later   becomes a support line! The reson for this is so amusing that after   one reads about it we just go ""wow..."""" Now I understand why   this occurs"". Murphy's book is not about strategy or which tools to use. He takes an objective approach to describing the basics about various tools and techniques, and leaves it up to the reader to decide which tools to apply and when. That's why it's 576 pages and a great reference whenever you're working.  If you make it through and understand Murphy, then you'll be golden. Again, understand the theory first, but make sure to see how it's applied as well - otherwise you're just reading without any practical knowledge. To quote Richard Feynman: It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.  Personally, I think technical analysis is all BS and a waste of time, and most of the top investors would agree, but at the end of the day, ignore everyone and stick to what works for you. Best of luck!" Haha, I used to work for a head of research whose favorite pastime seemed to be putting together these kinds of charts.  Edit: And the funny thing is people who take this chart at face value shouldn't want to short anyway - the balance sheet is going to flatline for sometime before they start letting it run off - so at most it suggests that people utilize strategies that work in sideways markets. you could try [FRED](http://research.stlouisfed.org/fred2/graph/?g=HO7), or maybe try the CME and ICE's websites for some decent data.. haven't looked just suggestions - pretty sure the symbol for the Libor futures is EM, you could approximate from that so long as it's not a doctoral thesis