找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
首页论坛EAHub 外汇论坛
查看: 27|回复: 0

IndicatorBuffers( )【自定义指标篇-MQL4函数】

[复制链接]

4万

主题

54

回帖

4万

积分

管理员

积分
45954
发表于 2026-8-27 14:44:00 | 显示全部楼层 |阅读模式
void IndicatorBuffers( int count)

对于缓冲储存器分配记忆应用自定义指标计算。缓冲储存器的总数不能超过8或者是小于自定义缓冲 属性中所给出的值。 如果客户指标要求另外的缓冲器计数,那么这个功能必须使用为指定总额缓冲。


参数:

count   -   在指标缓冲器和8缓冲储存器之间分配缓冲储存器的总量。


示例:


#property  indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Silver
//---- 自定义参量
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- 自定义缓冲
double     ind_buffer1[];
double     ind_buffer2[];
double     ind_buffer3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 使用2个添加缓冲。
   IndicatorBuffers(3);
//---- 画出设定
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,3);
   SetIndexDrawBegin(0,SignalSMA);
   IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);
//---- 绘制3 个添加缓冲位置
   SetIndexBuffer(0,ind_buffer1);
   SetIndexBuffer(1,ind_buffer2);
   SetIndexBuffer(2,ind_buffer3);
//----  DataWindow 和自定义窗口标签名称
   IndicatorShortName("OsMA("+FastEMA+","+SlowEMA+","+SignalSMA+")");
//---- 初始化结束
   return(0);
  }复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|EAHub外汇论坛

GMT+8, 2026-10-10 00:14 , Processed in 0.101230 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表