Version 2.0 2018.01.23
Upgraded to work for pending order too