NinjaScript 8 – Calculating Historical Bid/Ask Delta Per Bar Without Order Flow+

You can see the code/logic in the my post here