TrendLineVisible
TrendLineVisible(获得方法)
获得趋势线可视标识。
bool TrendLineVisible()返回值
指定趋势线是否可见的标识值。
TrendLineVisible(设置方法)
设置趋势线可视标识。
void TrendLineVisible(
const bool visible //标识值
)参数
- visible
[in] 趋势线可视标识值。
示例:

以下即是提到的趋势线及其在图表绘制的代码:
//+------------------------------------------------------------------+
//| TrendLineGraphic.mq5 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#include <Graphics\Graphic.mqh>
//+------------------------------------------------------------------+
//| 脚本程序起始函数 |
//+------------------------------------------------------------------+
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};
//--- 创建图形
CGraphic graphic;
if(!graphic.Create(0,"TrendLineGraphic",0,30,30,780,380))
{
graphic.Attach(0,"TrendLineGraphic");
}
//--- 创建曲线
CCurve *curve=graphic.CurveAdd(x,y,CURVE_POINTS);
//--- 设置曲线属性
curve.TrendLineVisible(true);
curve.TrendLineColor(ColorToARGB(clrRed));
//--- 绘制
graphic.CurvePlotAll();
graphic.Update();
}