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