TrendLineVisible (Метод Get)

Возвращает флаг, который определяет видимость трендовой линии.

bool  TrendLineVisible()

Возвращаемое значение

Значение флага, который указывает, видна ли трендовая линия.

TrendLineVisible (Метод Set)

Устанавливает флаг, который определяет видимость трендовой линии.

void  TrendLineVisible(
   const bool  visible      // значение флага 
   )

Параметры

visible

[in]  Значение флага, определяющего видимость трендовой линии.

Пример:

graphics_trend

Код построения вышеприведенной трендовой линии и ее отображения на графике:

//+------------------------------------------------------------------+
//|                                             TrendLineGraphic.mq5 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#include <Graphics\Graphic.mqh>
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   double x[]={12.0,11.5,11.0,12.0,10.5,10.0,9.0,8.5,10.0,8.5,10.0,8.0,9.5,10.0,15.0};
   double y[]={130.0,165.0,150.0,150.0,140.0,198.0,220.0,215.0,225.0,190.0,170.0,160.0,150.0,225.0,95.00};
//--- create graphic
   CGraphic graphic;
   if(!graphic.Create(0,"TrendLineGraphic",0,30,30,780,380))
     {
      graphic.Attach(0,"TrendLineGraphic");
     }
//--- create curve
   CCurve *curve=graphic.CurveAdd(x,y,CURVE_POINTS);
//--- sets the curve properties 
   curve.TrendLineVisible(true);
   curve.TrendLineColor(ColorToARGB(clrRed));
//--- plot 
   graphic.CurvePlotAll();
   graphic.Update();
  }