1

我在 MetaTrader 中编译时收到此错误:

indicator buffers amount is less than needed

有什么帮助吗?

4

2 回答 2

2

MQL4 指标设置可能看起来像是一场双重噩梦。
也许是,
也许不是:

指标设置有两种主要方法。

一个,使用#property ... 语法接口,另一个,使用函数调用...

为什么这两个存在?它们如何共存?

#property ...
indicator_chart_window                Show the indicator in the chart window
indicator_separate_window             Show the indicator in a separate window
indicator_height            int       Fixed height of the indicator subwindow in pixels (property INDICATOR_HEIGHT)
indicator_buffers           int       Number of buffers for indicator calculation
indicator_minimum           double    The bottom scaling limit for a separate indicator window
indicator_maximum           double    The top scaling limit for a separate indicator window
indicator_labelN            string    Sets a label for the N-th graphic series displayed in DataWindow
indicator_colorN            color     The color for displaying line N, where N is the number of graphic series; numbering starts from 1
indicator_widthN            int       Line thickness in graphic series, where N is the number of graphic series; numbering starts from 1
indicator_styleN            int       Line style in graphic series, specified by the values of ENUM_LINE_STYLE. N is the number of graphic series; numbering starts from 1
indicator_typeN             int       Type of indicator drawing style. N is the number of graphic series; numbering starts from 1
indicator_levelN            double    Horizontal level of N in a separate indicator window
indicator_levelcolor        color     Color of horizontal levels of the indicator
indicator_levelwidth        int       Thickness of horizontal levels of the indicator
indicator_levelstyle        int       Style of horizontal levels of the indicator

在 MQL4 学习一段时间后,您将采用自己的最佳方式继续前进。


为什么工作失败?

简短版本:编译时决策设置为指标时间序列对齐数据预设的数组数量。超过这个设定的上限必须抛出一个异常,因为没有更多的缓冲区来存储数据。

然而,首先设置一个更大的天花板是可能的,并且可能有助于在以后的某个时间保持足够的空间,即使你现在不使用它。

于 2015-10-30T23:02:12.277 回答
1

这似乎是一个问题:

#property indicator_buffers   XXX           //How Many Plots

XXX 应该是正确数量的缓冲区/地块

于 2015-10-26T21:35:54.750 回答