not understanding ATR calculation

not understanding ATR calculation

Manage alerts

Loading saved threads...

bob mcgee · External communityPost link
External question — Quantitative Finance Stack Exchange Author: bob mcgee Original post: https://quant.stackexchange.com/questions/79174 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. i don't quiet understand the result of the quantity of shares based on the ATR calculation (800(capital) * 3%(risk) / (2 * 0.44(ATR)) = 27, would the result be in shares?, because based on my risk per trade of 24 dollars per trade, i would not be able to afford 27 shares if the stock price is $4.4 so i obviously dont understand something of how this calculation works and what the results actually mean and i hoping someone would explain?
Quote
Report
nbbo2 · External communityPost link
External answer — Quantitative Finance Stack Exchange Author: nbbo2 Original post: https://quant.stackexchange.com/a/79200 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I will attempt an explanation of this formula. This is an overview. If you need more detail you should give more information about the problem you are trying to solve. First let's talk about gambling. The first rule of gambling is that if there is a negative expectation, you should not bet at all. If you have a positive expectation and you have finite capital, then it is generally a good idea to make several bets, not just one. This is because of the Risk of Ruin issue: you could be wiped out due to bad luck on the first one or a few consecutive trades. There is a mathematical theory of RoR, but to keep it simple you could just adopt a rule that you want to survive 20 losing trades, so you would bet 5% of your initial capital on each bet. This is just a rule of thumb, if you are daring you might bet 10% and if you are cautious you might bet 3% (as you rule does). Nothing very scientific here, it is a subjective preference. Now let's talk about trading financial instruments. The main difference is gambling has a binary (win/loss) outcome while trading has a continuous outcome. So risk measurement is more difficult. We can't use the worst loss because the worst that can happen to a stock is it goes to 0 and that's a 100% loss, though its rare. A rule based on the worst outcome would say we should not bet at all. To get around this we might say: I want to survive 20 "really bad trades" (RBTs) where a RBT is a big loss but not a complete wipeout. For example Value at Risk is defined as a loss that is exceeded fewer than 5% of the time. (Again a "magic 5%" that someone pulled out of the air, though it seems plausible and is commonly used). For intraday trading a plausible RBT would be a trade where you buy at the high of the day and sell at the low of the day. The range (=high-low) is a random variable but we could estimate it using the ATR (average true range, over say the last 60 days). Since the range (and risk in general) fluctuates over time and the ATR is an average measured in a past period, we could use really_bad_loss = 2*ATR to be on the safe side for the future. The result of all this "reasoning" is the formula you gave for the number of shares to hold: N = (0.03 capital) / (price_per_share / (2*ATR)) capital is in USD, price_per share is in US/shares and ATR is a pure number, so dimensionally the result is shares, as we wanted. Note the following limitations: It assumes day trading: once you get in you have to get the $\bullet$ out (GTFO in polite language) the same day. That limits your flexibility. For multi-day trading you would need more capital (you need to survive a price excursion of more that 2 ATR). It assumes you will use leverage, and computes for you how much leverage you will use. If the leverage ratio is > 1 (as in your numerical example) you will be buying on margin, which is not always a good idea (it increases the risk of ruin). If you don't use margin you cannot use this rule. It is an example of a "risk only" position sizing rule, which looks only at the down side and does not take into account the (assumed positive) expectation. Because estimating the expectation is difficult, this is quite common in position sizing. VaR is another example. But there are also rules (such as the Kelly Rule mentioned in a comment above) that take the expectation in account. It is a static rule, based on the initial capital and not on the current capital as it evolves over time (another feature of the Kelly rule). The coefficients 0.03 in the numerator and 2 in the denominator are somewhat arbitrary, as discussed. Hope this helps. Seeing the reasoning behind the rule could be helpful, since it also shows the limitations . No one should rely on a mathematical formula without understanding the justification behind it.
Quote
Report
Pedro Groppo · External communityPost link
External answer — Quantitative Finance Stack Exchange Author: Pedro Groppo Original post: https://quant.stackexchange.com/a/85833 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Building on nbbo2's answer, to directly address your two follow-up questions: 1) Why the formula gives more shares than you can afford The formula tells you how many shares to trade so that your risk (the loss if stopped out at 2×ATR away) equals 3% of capital. It does NOT check whether you can actually afford that many shares — those are two separate constraints: Risk constraint: shares × (2 × ATR) ≤ 0.03 × capital (this is what the formula solves) Affordability constraint: shares × price ≤ capital (or capital × max leverage, if margin is allowed) If the risk-based share count fails the affordability check, that usually means the asset's ATR relative to its price is small enough that hitting your risk target needs more capital than you have. The formula isn't wrong — it's telling you this trade, sized for your risk target, needs leverage you may not have. The fix is capping position size at min(risk-based size, affordability-based size), not distrusting the formula. 2) ATR vs. fixed % — what's actually different A fixed % stop (e.g. "always exit 2% below entry") sets your stop distance from price alone, ignoring how much the asset actually moves day to day. ATR-based sizing sets stop distance from the asset's own recent volatility instead. Concretely: two $50 stocks, one with ATR=$ 0.50 (calm), one with ATR= $3 (volatile). A flat 2% stop puts both stops $ 1 away. For the calm stock that's 2×ATR — reasonable. For the volatile one, that's a third of one ATR — it gets hit by ordinary noise, not because the trade thesis failed. ATR-based sizing gives each stock a stop distance proportional to how it actually moves, so position size adjusts too: fewer shares on the volatile name, more on the calm one, for the same dollar risk. That's the real tradeoff versus fixed %: a bit more complexity (computing ATR) in exchange for stops that reflect the asset's actual behavior instead of an arbitrary universal number.
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External answer — Quantitative Finance Stack Exchange Author: nbbo2 Source score (net votes, not local likes): 0 Original post: https://quant.stackexchange.com/a/79200 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I will attempt an explanation of this formula. This is an overview. If you need more detail you should give more information about the problem you are trying to solve. First let's talk about gambling. The first rule of gambling is that if there is a negative expectation, you should not bet at all. If you have a positive expectation and you have finite capital, then it is generally a good idea to make several bets, not just one. This is because of the Risk of Ruin issue: you could be wiped out due to bad luck on the first one or a few consecutive trades. There is a mathematical theory of RoR, but to keep it simple you could just adopt a rule that you want to survive 20 losing trades, so you would bet 5% of your initial capital on each bet. This is just a rule of thumb, if you are daring you might bet 10% and if you are cautious you might bet 3% (as you rule does). Nothing very scientific here, it is a subjective preference. Now let's talk about trading financial instruments. The main difference is gambling has a binary (win/loss) outcome while trading has a continuous outcome. So risk measurement is more difficult. We can't use the worst loss because the worst that can happen to a stock is it goes to 0 and that's a 100% loss, though its rare. A rule based on the worst outcome would say we should not bet at all. To get around this we might say: I want to survive 20 "really bad trades" (RBTs) where a RBT is a big loss but not a complete wipeout. For example Value at Risk is defined as a loss that is exceeded fewer than 5% of the time. (Again a "magic 5%" that someone pulled out of the air, though it seems plausible and is commonly used). For intraday trading a plausible RBT would be a trade where you buy at the high of the day and sell at the low of the day. The range (=high-low) is a random variable but we could estimate it using the ATR (average true range, over say the last 60 days). Since the range (and risk in general) fluctuates over time and the ATR is an average measured in a past period, we could use really_bad_loss = 2*ATR to be on the safe side for the future. The result of all this "reasoning" is the formula you gave for the number of shares to hold: N = (0.03 capital) / (price_per_share / (2*ATR)) capital is in USD, price_per share is in US/shares and ATR is a pure number, so dimensionally the result is shares, as we wanted. Note the following limitations: It assumes day trading: once you get in you have to get the $\bullet$ out (GTFO in polite language) the same day. That limits your flexibility. For multi-day trading you would need more capital (you need to survive a price excursion of more that 2 ATR). It assumes you will use leverage, and computes for you how much leverage you will use. If the leverage ratio is > 1 (as in your numerical example) you will be buying on margin, which is not always a good idea (it increases the risk of ruin). If you don't use margin you cannot use this rule. It is an example of a "risk only" position sizing rule, which looks only at the down side and does not take into account the (assumed positive) expectation. Because estimating the expectation is difficult, this is quite common in position sizing. VaR is another example. But there are also rules (such as the Kelly Rule mentioned in a comment above) that take the expectation in account. It is a static rule, based on the initial capital and not on the current capital as it evolves over time (another feature of the Kelly rule). The coefficients 0.03 in the numerator and 2 in the denominator are somewhat arbitrary, as discussed. Hope this helps. Seeing the reasoning behind the rule could be helpful, since it also shows the limitations . No one should rely on a mathematical formula without understanding the justification behind it.

Cancel quote

Checking account access…