1

I'm not able to get the values ​​of the vwap indicator, does anyone know why?

h_vwap = iCustom(Symbol(), Period(), "VWAP_Simple 2.00","Close price", "Daily", "Tick volume");

enter image description here

Demas Triz
  • 27
  • 3

1 Answers1

0

h_vwap is the handle of your custom indicator, it is not the value(s) that the indicator computes. You need to add some code to extract the values computed by the indicator. Specifically you need to declare an array that will receive the values.

double         Label1Buffer[];

then in the OnCalculate / OnTick function you need to copy the values to that buffer.

int copy=CopyBuffer(h_vwap,0,0,rates_total,Label1Buffer);

Read the doc of iCustom and of CopyBuffer and you can find nice step by step articles on mql5.com such as this one

Ben2209
  • 1,071
  • 4
  • 11
  • 24