The calculation of the number of shares is equal to a % of your current equity (cash plus P&L) divided by the risk per share.
For example with $20 000 of equity and 1% risk you will have $200
per trade available of risk. This is $20,000 x 0.01 =
$200.
For a stock like KORS in TA on the 08-27-2013 the entry price is
$73.69 (last swing hi + buffer) and the protective stop is $68.73
(last swing low - buffer). The difference between the entry and
exit price will give the risk per share. In this example, $73.69 -
$68.73 = $4.96 per share.
The final step to find the number of shares is to divide the current
risk ($200) by the risk per share ($4.96). In this example $200 /
$4.96 = 40.32.
With 1% of risk with an equity of $20,000 we can buy 40 shares of
KORS in TA based on the information of the 08-27-2013.
You will notice that the buffer is included in the risk per share to
avoid surprises in the long run. Also note that in real trading the
buy price that you get from the market could be equal or higher
than your buy price. This affects your risk per trade but we cannot anticipate it.
Update 2016-06: You have the option in include the Transaction Cost into your risk now.