MQL4参考 自定义指标 IndicatorDigits

IndicatorDigits

Sets precision format (the count of digits after decimal point) to visualize indicator values.

void  IndicatorDigits(
   int     digits         // digits
   );

Parameters

digits

[in]  Precision format, the count of digits after decimal point.

Returned value

None.

Note

The symbol price preicision is used by default, the indicator being attached to this symbol chart.

Example:

int init()
  {
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(3);
//---- setting of drawing parameters
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(Digits+2);
//---- 3 allocated buffers of an indicator
   SetIndexBuffer(0,ind_buffer1);
   SetIndexBuffer(1,ind_buffer2);
   SetIndexBuffer(2,ind_buffer3);
//---- "short name" for DataWindow and indicator subwindow
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- initialization done
   return(0);
  }

See also

Custom Indicator Properties