Basic Library to Create Volume Profiles – library MetaTrader 5

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

class VolumeProfile
  {
...
public:
   void              VolumeProfile(datetime _from, datetime _to);
                    ~VolumeProfile() {};
   double            GetHVPrice();
   void              Plot();
...
  };

  • GetHVPrice returns the price that is related to highest volume in the range.

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);
      VP.Plot();
      Print(VP.GetHVPrice());
      delete VP;
  }

Volume Profile

📈 ROBOTFX MetaTrader Expert Advisors and Indicators to maximize profits and minimize the risks