added auto-detection of market level