Replaced market data access by index to namedtuple. Fixed few calculation issues.