MT5中OnCaculate事件的第2中使用方法 [MT4]
作者:
MT4 來源:
cxh99.com 發(fā)布時間:2012年05月23日 點擊數(shù):
【
收藏到本網的會員中心】
- 方法如下:
復制代碼-
- int OnCalculate (const int rates_total, // the size of the price[] array
- const int prev_calculated, // bars calculated in the previous call
- const int begin, // where notional data start from
- const double& price[] // data array for calculation
- );
可以看出這里的參數(shù)只有一個數(shù)組price,沒有常見的time open high low close那些
上述調用方法用于單個外部數(shù)據(jù)數(shù)組的調用和計算。
最后的參數(shù)是一個用戶選擇好的單獨數(shù)組,它用于后面的指標計算。
應用在指標屬性窗口里是這樣的:
注意:這里如果你選擇了一個自定義指標而且是多個數(shù)組的,那么只有第一個數(shù)組會被應用于這個最后參數(shù)里傳遞過來。
上面有 First indicator 和 previous indicator's data的選項,這可以讓我們實現(xiàn)“針對技術指標的技術指標”
例如:通過加載三次同一個均線指標,輕松實現(xiàn)“三次平滑后的均線”的目的。
栽自:www.520fx.com