Update dictionary in constant time in Python
You can accomplish this using the standard collections.OrderedDict. According to the docs: 


  Deleting an entry and reinserting it will move it to the end.


By default, the presentation will be in insertion order. For you, that is reversed, so you will want to reverse the ordering when you iterate (using .keys() or .items()).

Update

To use the ordered dictionary, you'll have to import collections (unless you're using python3.6, where I think dictionaries become ordered by default- check that).

So:

import collections

od = collections.OrderedDict()

def insert(ticker, price):
    '''
    Insert a ticker-&gt;price pair. If ticker is already stored, move it
    to the end (last updated). 
    '''
    if ticker in od:
        del od[ticker]

    od[ticker] = price

def each_ticker():
    '''Return ticker symbols in reverse order of insertion'''
    return reversed(od.keys())

def each_ticker_price():
    '''Return (ticker, price) pairs in reverse order of insertion'''
    return reversed(od.items())


insert('AAPL', 100)
insert('MSFT', 200)
insert('GOOG', 300)
insert('AAPL', 400)
insert('MSFT', 350)

for name, price in each_ticker_price():
    print(name, "trading at", price)


Output is:

$ python test.py
MSFT trading at 350
AAPL trading at 400
GOOG trading at 300