发新话题
打印

[指标EA编写讨论] 求教高手,如何在新指标里引用自定义指标

本主题由 xfxyldj 于 2007-10-31 09:56 分类

求教高手,如何在新指标里引用自定义指标

原有自定义指标I1,输出三个曲线数据D1,D2,D3
新制作了一个指标I2,想引用I1.D1的数据,怎么做呢?
先谢过各位高手。

TOP

回复 1楼 的帖子

用iCustom()函数。
定义说明如下:
double iCustom( string symbol, int timeframe, string name, ..., int mode, int shift)
Calculates the specified custom indicator and returns its value. The custom indicator must be compiled (*.EX4 file) and be in the terminal_directory\experts\indicators directory.

Parameters:
symbol   -   Symbol the data of which should be used to calculate indicator. NULL means current symbol.
timeframe   -   Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
name   -   Custom indicator compiled program name.
...   -   Parameters set (if necessary). The passed parameters and their order must correspond with the desclaration order and the type of extern variables of the custom indicator.
mode   -   Line index. Can be from 0 to 7 and must correspond with the index used by one of SetIndexBuffer functions.
shift   -   Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

英文的。将就着看吧。呵呵。

TOP

谢谢楼上大侠!!
这么快就解决了困惑!

TOP

回复 3楼 的帖子

希望能帮到你。

TOP

发新话题