This library provides a few simple public methods to create and plot Volume Profiles:

public:
   void              VolumeProfile(datetime _from, datetime _to, int _resolution_points);
                    ~VolumeProfile() {};
   double            GetHVPrice();
   void              Plot();
  • GetHVPrice returns the price that is related to highest volume in the range.
  • _resolution_points holds the window size to quantize adjacent prices(counted in points)

Here is a sample script to instantiate and plot a desired Volume Profile:

#include <VolumeProfile.mqh>
void OnStart()
  {
      datetime from=iTime(_Symbol, PERIOD_CURRENT,50);
      datetime to=iTime(_Symbol, PERIOD_CURRENT,20);
      VolumeProfile *VP = new VolumeProfile(from, to, 5);
      VP.Plot();
      Print(VP.GetHVPrice());
      delete VP;
  }