MetaTrader:指标缓冲量小于需要量

时间:2015-10-26 21:32:56

标签: mql4 metatrader4

我在MetaTrader编译中遇到此错误:

  

indicator buffers amount is less than needed

任何帮助?

2 个答案:

答案 0 :(得分:1)

MQL4 Indicator setup may look as a dual-headed nightmare.
Maybe yes,
maybe no:

There are two principal methods used for an Indicator setup.

one, using #property ... syntax interface, and another, using function calls ...

Why these two exist? How do they co-exist?

#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

After some time in MQL4 you will adopt your own best way to go forwards.


Why failed to work?

Short version: a compile-time decision sets the amount of arrays preset for indicator time-series aligned data. Going past this set ceiling then must throw an exception as there is no further buffer to store data in.

However, setting a much bigger ceiling first is possible and may help, somewhere at a later time, to have still space enough, even when you do not use it right now.

答案 1 :(得分:0)

这似乎是一个问题:

#property indicator_buffers   XXX           //How Many Plots

XXX应该是正确数量的缓冲区/图表