Should I use regular or adjusted close for backtesting?
You would have to compare your backtesting to what you will be doing in real trading, and try to have the backtesting as close to your real trading as possible. Note: you may never get the backtesting to match your real trading exactly but you need to get as close as possible. The whole purpose of backtesting is to check if your trading strategies - your signals, entries and exits, and your stops - are profitable over various market conditions. As you would be using actual closes to do your real trading you should be using this to also do your backtesting. Rather than using adjusted data to get an idea of your total return from your backtesting, you can always add the value of the dividends and other corporate actions to the results from using the actual data. You may even find a way to add any dividends and other corporate action to your results automatically, i.e. any dividend amount added to your total return if the stock is held during the ex-dividend date. If you are using adjusted data in your backtesting this may affect any stops you have placed, i.e. it may cause your stop to be triggered earlier or later than in real trading. So you will need to determine how you will treat your stops in real trading.  Will you adjust them when there is corporate action such as dividends?  Or will you leave them constant until actual prices have gone up? If you will be leaving your stops constant then you should definitely be using actual data in your backtesting to better match your real trading. A one year period of study - Stock A trades at $100, and doesn't increase in value, but has $10 in dividends over the period.  Stock B starts at $100, no dividend, and ends at $105. However you account for this, it would be incorrect to ignore stock A's 10% return over the period.  To flip to a real example, MoneyChimp shows the S&P return from Jan 1980 to Dec 2012 as +3264% yet, the index only rose from 107.94 to 1426.19 or +1221%.  The error expands with greater time and larger dividends involved, a good analysis won't ignore any dividends or splits. If you want to monitor how well you did in choosing your investments you will want to use stock prices that account for the dividends and splits and other changes (not just the closing price).  The adjusted close will include these changes where the straight close will not include them.  Using the adjusted close you will get your true percentage change.  For example I have a stock called PETS that paid an $0.18 dividend in July 2015. The adjusted closes before that day in July are all $0.18 lower per share.  Say the closing price had been unchanged at $20.00.  The close prices would say I made no profit, but the adjusted closing price would say I made $0.18 per share on this investment because the adjusted close would read $19.82 in June 2015 but would read $20.00 in August 2015 (just like the closing price).  The adjusted close allows me to know my true profit per share.
The values of 12, 26 and 9 are the typical industry standard setting used with the MACD, however other values can be substituted depending on your trading style and goals. The 26d EMA is considered the long moving average when in this case it is compared to the shorter 12d EMA. If you used a 5d EMA and a 10d EMA then the 10d EMA would be considered the long MA. It is based on what you are comparing it with. Apart from providing signals for a reversal in trend, MACD can also be used as an early indication to a possible end to a trend. What you look out for is divergence between the price and the MACD. See chart below of an example:  Here I have used 10d & 3d EMAs and 1 for the signal (as I did not want the signal to show up). I am simply using the MACD as a momentum indicator - which work by providing higher highs in the MACD with higher highs in price. This shows that the momentum in the trend is good so the trend should continue. However the last high in price is not met with a higher high in the MACD. The green lines demonstrate bearish divergence between price and the MACD, which is an indication that the momentum of the trend is slowing down. This could provide forewarning that the trend may be about to end and to take caution - i.e. not a good time to be buying this stock or if you already own it you may want to tighten up your stop loss. Two ways to solve this.  Look at the answer. If the answer says 3 months, then using ceiling for similar questions. You have to act according to the exam conventions, not according to own feelings. Whether or not the answer is reasonable and applicable in real life is out of the question.  Ask yourself, did the investment double after 14 years 2 months? i.e. FV >= 2PV. Does a person who ran 99.72 meters in a 100-meter dash counted as touching the finish line? There is no right way but changing your methodology to suit your situation is   a problem. They were happy to use a 4 years period during the crazy times to lower the VAR and then switch to 1 year afterwards to do the same. It is picking and choosing your measures to suit the situation and that is statistical heresy. While there may not be a right way to measure VAR choosing the measure that is suits your situation is bad methodology.    And of course there is such a thing as bad statistical methodology, you see it everyday.   I also pointed out above that it vairies from bank to bank what confidence interval you use. Simple math: 50-25=25, hence decline from 50 to 25 is a 50% decline (you lose half), while an advance from 25 to 50 is 100% gain (you gain 100%, double your 25 to 50). Their point is that if you have more upswings than downswings - you'll gain more on long positions during upswings than on short positions during downswings on average. Again - simple math. "TL;DR; There is no silver bullet. You have to decide how much to invest and when on your own.  Averaging down definition: DEFINITION of 'Average Down' The process of buying additional shares in a company at lower prices than you originally purchased. This brings the average price you've paid for all your shares down. BREAKING DOWN 'Average Down' Sometimes this is a good strategy, other times it's better to sell off a beaten down stock rather than buying more shares.  So let us tackle your questions: At what percentage drop of the stock price should I buy more shares. (Ex: should I wait for the price to fall by 5% or 10% to buy more.) It depends on the behaviour of the security and the issuer. Is it near its historical minimum? How healthy is the issuer? There is no set percentage. You can maximize your gains or your losses if the security does not rebound. Investopedia: The strategy is often favored by investors who have a long-term investment horizon and a contrarian approach to investing. A contrarian approach refers to a style of investing that is against, or contrary, to the prevailing investment trend.  (...) On the other side of the coin are the investors and traders who generally have shorter-term investment horizons and view a stock decline as a portent of things to come. These investors are also likely to espouse trading in the direction of the prevailing trend, rather than against it. They may view buying into a stock decline as akin to trying to ""catch a falling knife."" Your second question: How many additional shares should I buy. (Ex: Initially I bought 10 shares, should I buy 5,10 or 20.) That depends on your portfolio allocation before and after averaging down and your investor profile (risk apettite). Take care when putting more money on a falling security, if your portfolio allocation shifts too much. That may expose you to risks you shouldn't be taking. You are assuming a risk for example, if the market bears down like 2008: Averaging down or doubling up works well when the stock eventually rebounds because it has the effect of magnifying gains, but if the stock continues to decline, losses are also magnified. In such cases, the investor may rue the decision to average down rather than either exiting the position or failing to add to the initial holding.  One of the pitfalls of averaging down is when the security does not rebound, and you become too attached to be able to cut your losses and move on. Also if you are bullish on a position, be careful not to slip the I down and add a T on said position. Invest with your head, not your heart." "The formula for standard deviation is fairly simple in both the discrete and continuous cases. It's mostly safe to use the discrete case when working with adjusted closing prices. Once you've calculated the standard deviation for a given time period, the next task (in the simplest case) is to calculate the mean of that same period. This allows you to roughly approximate the distribution, which can give you all sorts of testable hypotheses. Two standard deviations (σ) away from the mean (μ) is given by:  It doesn't make any sense to talk about ""two standard deviations away from the price"" unless that price is the mean or some other statistic for a given time period. Normally you would look at how far the price is from the mean, e.g. does the price fall two or three standard deviations away from the mean or some other technical indicator like the Average True Range (an exponential moving average of the True Range), some support level, another security, etc.  For most of this answer, I'll assume we're using the mean for the chosen time period as a base. However, the answer is still more complicated than many people realize. As I said before, to calculate the standard deviation, you need to decide on a time period. For example, you could use S&P 500 data from Yahoo Finance and calculate the standard deviation for all adjusted closing prices since January 3, 1950. Downloading the data into Stata and applying the summarize command gives me: As you can probably see, however, these numbers don't make much sense. Looking at the data, we can see that the S&P 500 hasn't traded close to 424.4896 since November 1992. Clearly, we can't assume that this mean and standard deviation as representative of current market conditions. Furthermore, these numbers would imply that the S&P 500 is currently trading at almost three standard deviations away from its mean, which for many distribution is a highly improbable event. The Great Recession, quantitative easing, etc. may have changed the market significantly, but not to such a great extent.  The problem arises from the fact that security prices are usually non-stationary.. This means that the underlying distribution from which security prices are ""drawn"" shifts through time and space. For example, prices could be normally distributed in the 50's, then gamma distributed in the 60's because of a shock, then normally distributed again in the 70's. This implies that calculating summary statistics, e.g. mean, standard deviation, etc. are essentially meaningless for time periods in which prices could follow multiple distributions.  For this and other reasons, it's standard practice to look at the standard deviation of returns or differences instead of prices. I covered in detail the reasons for this and various procedures to use in another answer. In short, you can calculate the first difference for each period, which is merely the difference between the closing price of that period and the closing price of the previous period. This will usually give you a stationary process, from which you can obtain more meaningful values of the standard deviation, mean, etc.  Let's use the S&P500 as an example again. This time, however, I'm only using data from 1990 onwards, for the sake of simplicity (and to make the graphs a bit more manageable). The summary statistics look like this: and the graph looks like this; the mean is the central horizontal red line, and the top and bottom lines indicate one standard deviation above and below the mean, respectively.   As you can see, the graph seems to indicate that there were long periods in which the index was priced well outside this range. Although this could be the case, the graph definitely exhibits a trend, along with some seemingly exogenous shocks (see my linked answer).  Taking the first difference, however, yields these summary statistics: with a graph like this:  This looks a lot more reasonable. In periods of recession, the price appears much more volatile, and it breaches the +/- one standard deviation lines indicated on the graph.  This is only a simple summary, but using first differencing as part of the wider process of detrending/decomposing a time series is a good first step.  For some technical indicators, however, stationary isn't as relevant. This is the case for some types of moving averages and their associated indicators. Take Bollinger bands for instance. These are technical indicators that show a number of standard deviations above and below a moving average. Like any calculation of standard deviation, moving average, statistic, etc. they require data over a specified time period. The analyst chooses a certain number of historical periods, e.g. 20, and calculates the moving average for that many previous periods and the moving/rolling standard deviation for those same periods as well. The Bollinger bands represent the values a certain number of standard deviations away from the moving average at a given point in time. At this given point, you can calculate the value two standard deviations ""away from the value,"" but doing so still requires the historical stock price (or at least the historical moving average). If you're only given the price in isolation, you're out of luck.  Moving averages can indirectly sidestep some of the issues of stationarity I described above because it's straightforward to estimate a time series with a process built from a moving average (specifically, an auto-regressive moving average process) but the econometrics of time series is a topic for another day.  The Stata code I used to generate the graphs and summary statistics:" I have never seen a backtest showing that prices tended to be attracted by / to revert around Fibonacci levels. The fact that many people use them doesn't mean that they can be turned into a profitable system... I have on the other hand seen many backtests showing that they don't do anything, such as the one described in this article: At least in this sample of market data, using this particularly specification for swings, we find no evidence that Fibonacci ratios are significant in the market.   Perhaps I have missed something significant, or perhaps I am merely completely wrong in my analysis, but one thing should be clear—the burden of proof should lie on the people offering arcane and complex methodologies, when simpler methods work just as well or better in the marketplace. If Fibonacci ratios are the key to the markets, where are the quantitative tests? Where’s the proof? If you had a trading system, and by trading system I mean the criteria setup that you will take a trade on, then once a setup comes up at what price will you open the trade and at what price you will close the trade. As an example, if you want to buy once price breaks through resistance at $10.00 you might place your buy order at $10.05. So once you have a written trading system you could do backtesting on this system to get a percentage of win trades to loosing trades, your average win size to average lose size, then from this you could work out your expectancy for each trade that you follow your trading system on. The author is using the simple Dietz method, (alternatively the modified Dietz), with the assumption that the net cash-flow occurs halfway through the time period.  Let's say the time period is one year for illustration, so the cash-flow would be at the end of the second quarter. The money-weighted method gives a more accurate return, but has to be solved by trial-and-error or using a computer.  The money-weighted return is 11.2718 % and the simple or modified Dietz return is 11.2676 %.  When the sums are done backwards to check, the Dietz is half a dollar out with a final value of $11,999.50 while the money-weighted return recalculates exactly $12,000. It is worth pointing out that the return changes if the cash-flow is not in the middle of the time period.  A case with the cash-flow at the end of Q3 is added to illustrate. "Though you're looking to repeat this review with multiple securities and events at different times, I've taken liberty in assuming you are not looking to conduct backtests with hundreds of events.  I've answered below assuming it's an ad hoc review for a single event pertaining to one security. Had the event occurred more recently, your full-service broker could often get it for you for free.  Even some discount brokers will offer it so.  If the stock and its options were actively traded, you can request ""time and sales,"" or ""TNS,"" data for the dates you have in mind.  If not active, then request ""time and quotes,"" or ""TNQ"" data. If the event happened long ago, as seems to be the case, then your choices become much more limited and possibly costly.  Below are some suggestions: Wall Street Journal and Investors' Business Daily print copies have daily stock options trading data.  They are best for trading data on actively traded options.  Since the event sounds like it was a major one for the company, it may have been actively traded that day and hence reported in the papers' listings.  Some of the print pages have been digitized; otherwise you'll need to review the archived printed copies. Bloomberg has these data and access to them will depend on whether the account you use has that particular subscription.  I've used it to get detailed equity trading data on defunct and delisted companies on specific dates and times and for and futures trading data.  If you don't have personal access to Bloomberg, as many do not, you can try to request access from a public, commercial or business school library. The stock options exchanges sell their data; some strictly to resellers and others to anyone willing to pay.  If you know which exchange(s) the options traded on, you can contact the exchange's market data services department and request TNS and / or TNQ data and a list of resellers, as the resellers may be cheaper for single queries." "You can't do this automatically; you want to understand whether the drop is from a short-term high. is likely to be a short-term low, or reflects an actual change in how folks expect the company to do in the future. Having said that, some people do favor a strategy which resembles this, betting on what are known as ""the dogs of the Dow"" in the assumption that they're well trusted but not as strongly sought and therefore perhaps not bid up as strongly. I have no opinion on it; I'm just mentioning it for comparison." I don't think user4358's explanation is correct.  A trailing LIT Sell Order adjusts downwards, i.e. if you place the order with an Aux price (in TWS it's trigger price) of 105.00 and a trailing amount of 6.00 then, assuming the ask is 100.00, TWS will add the trailing amount to the ask price and if it's less than the trigger price it will adjust. So in my example, if the market (ask) goes straight up to 105.00, nothing will be adjusted, the trigger is touched and the limit order will be placed (see below). If on the the other hand the market goes down to 99.00 then trlng amt + ask is 105.00, if it goes further down to 98.00 then the trigger price will be adjusted to 104.00 (because it's less than the current trigger), and so on. For the LIT part you have either an absolute limit price you can enter, or you have an offset limit which will be subtracted from the trigger price, in which case it is adjusted as well. So back to my example, the trigger is now 104.00 and the limit offset is say 1.00, so my limit order would be placed at 103.00 if the ask ever touches 104.00, and that in turn is only visible if the bid touches 103.00 (because it's limit-if-touched). For a buy just use the same explanation with some swapped roles, the trigger price adjust upwards when the trailing amount plus bid is larger than the current trigger, and the limit offset will be added to the trigger price. Edit Also quite succinct and worth having a look at: http://www.interactivebrokers.com/en/trading/orders/trailingLimitTouched.php Guesswork, highly subjective As for why this might be good, well, you have to believe in momentum strategies, i.e. a market that goes down, will continue to go down, if you believe that and you believe in mean reversion as well, then a trailing limit order can assist you in not buying/selling impulsively, but closer to the mean.  I've never used it that way though. What I have done, even just now to get the explanation right, is to place trailing buy and sell orders simultaneously.  You will find that you can just go in with coarse estimates and because the adjustments will go towards each other, you will end up with a narrowing band of trigger prices (as opposed to trailing stop orders which will give you a widening band of trigger prices).  If you believe in overshooting and equilibria then this can be one easy way to profit from it.  I've just sold EURUSD for 1.26420 and bought it back at 1.26380 with a trailing amount of 5pips and a limit offset of 2pips within the time of writing this. Ok, so disregarding passivity, could you help me through a simplified example?   Say I only had two assets, SPY and TLT, with a respective weight of 35 and 65% and I want want to leverage this to 4x.  Additionally, say daily return covar is:  * B/B .004% * B/S -.004% * S/S .02%   Now, if I read correctly, I should buy ATM calls xxx days in the future.  Which may look like: Ticker, S, K, Option Price, Delta, Lambda  * TLT  $126.04  $126.00  $4.35  0.50  14.5 * SPY  $134.91  $134.00  $6.26  0.55  11.8  ^ This example is pretty close but some assets are far off.   I feel like I'm on the wrong track so I'll stop here.    I just want to lever up my risk-parity. Margin rates are too high and I'm docked by Reg-T. I would also be getting out of the stock market if I noticed prices starting to fall and a crash possibly on the way. There are some good and quite simple techniques I would use to time the markets over the medium to long term. I have described some of them in the answer to this question of mine: What are some simple techniques used for Timing the Stock Market over the long term? You could use similar techniques in your investing. And in regards to back-testing DCA to Timing The Markets, I have done that too in my answer to the following question: Investing in low cost index fund — does the timing matter? Timing the Markets wins hand down. In regards to back-testing and the concerns Kent Anderson has brought up, when I back-test a trading strategy, if that strategy is successful, I then forward test it over a year or two to confirm the results. As with back-testing you can sometimes curve fit your criteria too much. By forward testing you are confirming that the strategy is robust over different market conditions. One strategy you can take when the market does start to fall is short selling, as mentioned by some already. I am now short selling using CFDs over the short to medium term as one of my more aggressive strategies. I have a longer term strategy where I do not short, but tighten my stop losses when the market starts to tank. Sometimes my positions will keep going up even though the market as a whole is heading down, and I can make an extra 5% to 10% on these positions before I get taken out. The rare position even continues going up during the whole downturn and when the market starts to recover. So I let the market decide when I get out and when I stay in, I leave my emotions out of it. The best thing you can do is have a written trading plan with all your criteria for getting into the market, your criteria for getting out of the market and your position sizing and risk management incorporated in the plan. "Back-testing itself is flawed. ""Past performance is no guarantee of future results"" is an important lesson to understand. Market strategies of one kind or another work until they don't.  Edited in -- AssetPlay.net provides a tool that's halfway to what you are looking for. It only goes back to 1972, however. Just to try it, I compared 100% S&P to a 60/40 blend of S&P with 5 yr t-bills (a misnamed asset, 5 yr treasuries are 'notes' not 'bills') I found the mix actually had a better return with lower volatility.  Now, can I count on that to work moving forward? Rates fell during most of this entire period so bonds/notes both looked pretty good. This is my point regarding the backtest concept.  GeniusTrader appears more sophisticated, but command line work on PCs is beyond me. It may be worth a look for you, JP. ETF Replay appears to be another backtest tool. It has its drawbacks, however, (ETFs only)"