Hi, actually for securities it's FILO (First in, last out) or LIFO (Last in First out)
Further is you're asking this for tax purposes there are some constraints (Ill get to averagig n a mkinute)
"If" you're asking for ax purposes ...
IRS taxes stock sales using the FIFO method, unless you can provide proof that you used the specific identification method to sell your stocks in a different order. If you want your broker to identify the stocks that you plan to sell then you must provide your broker with the original purchase date and purchase price of those stocks. Your broker must give you written confirmation that those specific stocks where the ones that were sold. You cannot retroactively characterize your stock sale as a LIFO or FILO sale.
In regards XXXXX XXXXX basis,
In this method, all of your shares in a mutual fund have the same basis, which is the average cost (or other basis) of all shares at the time they were purchased (adjusted for previous sales followed by subsequent purchases). Shares are still sold in the order purchased. In the example above, you paid $18,000 for 400 shares, so your average basis is $45 a share; when you sell 100 shares at $60, your basis is $4500, your sales price is $6000, and the capital gain is $1,500. It is a long-term gain since you sold the shares you bought ten years ago.
Once you have averaged shares, they remain averaged for future transactions. In the example above, your basis is $45 in all 300 remaining shares; if you change to specific identification in the future, you cannot sell shares with a $30 or $60 basis.
SO, whaqt you really have os LIFO, specific share identification and Averaging under on of the accepted methods
Here's an excellent article on this: http://www.bogleheads.org/wiki/Cost_basis_methods
Hope this helps