I would like to sort through a list of securities and find the one that has performed the best in the last 60 days. My intent is to then buy that best performing security after selling the previous best performing security. (I believe this strategy/method is called "paired switching.") The attached algo does this, but with the outdated batch_transform method. I was wondering if anyone knew how to use the history function achieve duplicate results (exact same functionality) and possibly clean up the code. Thanks and sorry if my English is not perfect.