In object-oriented programming, a class is a blueprint for creating objects, defining a data structure’s state (properties) and behavior (methods). MQL5 and C# (cTrader) support classes. For example, one might define a MovingAverage
class with properties for period and methods to calculate values. A cBot
itself is defined as a C# class extending the cTrader API base class, encapsulating trading logic and event handlers.