try modifying like this example for buffers
// Define the buffer arrays double BufferPOC[]; double BufferHVN[]; // Modify the existing code to store values in the buffers void CalculateVP() { // ... Existing code ... for(int n = 0; n < ExtPrecision; n++) { // ... Existing code ... // Store values in the buffers int idx = iBarShift(_Symbol, CurrentTF, nodeTime); BufferPOC[idx] = (profile[n] == POC) ? nodePrice : EMPTY_VALUE; BufferHVN[idx] = (profile[n] != POC && profile[n] >= (POC * HVNRatio)) ? nodePrice : EMPTY_VALUE; // ... Existing code ... } } // Example usage in OnCalculate int OnCalculate(const int rates_total, const int prev_calculated, const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { // Calculate VP CalculateVP(); // ... Rest of the OnCalculate function ... }
Thanks a lot for your reply. I did try your suggestion but it did not worked. May be I am lacking some skills to implement it.
Another issue indicator calculates VP OnChartEvent (moving VPBegin and VPEnd) lines.
Let me try options to remove use of OnChartEvent and than apply your suggestion.
Will revert back here, if failed to get solution.
Regards.
Hello Mr. Anil Varma thank you for your educated threads . I'm really happy to talk to a forex programming legend. I'm new to forex and i'm doing some researches of indicators programming . I found some difficulties especially for adding the value area of an indicator.
please can you help me by modiffyng this indicator - the volume-profile-on-time-range- by adding to it a variable value area.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear Fellows
I am trying to customize Volume Profile indicator https://www.mql5.com/en/code/47784 and make it EA Friendly to get signals for POC Price (png attached), HVN and LVN Prices.
Google search did not helped much and all the VP Indicators lack the Buffers. Is it really impossible to created indicator buffers for VP?
If not possible than how can I compare in the EA if current price at a certain VP Node?
As OBJ_RECTANGLE_LABEL is used in drawing the objects (Nodes), I can not use 'ObjectGetValueByTime()' or 'ObjectGetDouble()' methods
Or Gurus here can guide me some way to make it possible?
I am able to decode the 'Price' of a given node highlighted code, however failed to convert horizontal bars to vertical bar array!!!
Your guidance is highly appreciated in advance.
Regards.