
public event Action<MarketDepth> MarketDepthUpdateEvent;
The MarketDepthUpdateEvent informs subscribers about changes in the order book data and sends out a MarketDepth object, which is indeed the aggregated order book. Typically, the event is used in strategies based on the analysis of the exchange order book.
Let's consider an example where a trading algorithm analyzes the cumulative volume of buyers and sellers orders, and based on this information, if certain conditions are met, opens positions.

1. Create a parameter that will contain a multiplier to determine the tilt of buyers to sellers.
2. Subscribe to the MarketDepthUpdateEvent.
3. Ignore the event if there are no buyers or sellers in the order book.
4. If there are no positions, proceed to entry logic.
5. In the OpenLogic method, retrieve levels with the best offer and best bid. In the lists of levels, they are always located at the zero index.
6. If the volume of the best bid is less than the volume of the best offer, exit the method.
7. If the total volume of all buyers is less than the product of the total volume of sellers and the given multiplier, also exit the method.
8. All conditions for going long are met, open the position.
If you have any difficulties or questions, please write to the support chat. Link