MT5中OnCaculate事件的第2中使用方法
作者:MT4 來源:cxh99.com 發布時間:2012年05月23日
- 方法如下:
復制代碼-
- 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
- );
可以看出這里的參數只有一個數組price,沒有常見的time open high low close那些
上述調用方法用于單個外部數據數組的調用和計算。
最后的參數是一個用戶選擇好的單獨數組,它用于后面的指標計算。
應用在指標屬性窗口里是這樣的:
注意:這里如果你選擇了一個自定義指標而且是多個數組的,那么只有第一個數組會被應用于這個最后參數里傳遞過來。
上面有 First indicator 和 previous indicator's data的選項,這可以讓我們實現“針對技術指標的技術指標”
例如:通過加載三次同一個均線指標,輕松實現“三次平滑后的均線”的目的。
栽自:www.520fx.com