技術指標調用 [Technical Indicator calls]
double iAC( string symbol, int timeframe, int shift)
計算 Bill Williams' Accelerator/Decelerator oscillator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
示例:
double result=iAC(NULL, 0, 1);
double iAD( string symbol, int timeframe, int shift)
計算 Accumulation/Distribution indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
示例:
double result=iAD(NULL, 0, 1);
double iAlligator( string symbol, int timeframe, int jaw_period, int jaw_shift, int teeth_period, int teeth_shift, int lips_period, int lips_shift, int ma_method, int applied_price, int mode, int shift)
計算 Bill Williams' Alligator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
jaw_period - 顎線週期
jaw_shift - 顎線位移
teeth_period - 齒線週期
teeth_shift - 齒線位移
lips_period - 唇線週期
lips_shift - 唇線位移
ma_method - 移動平均線種類
applied_price - 應用價格類型
mode - 來源模式,MODE_GATORJAW,MODE_GATORTEETH 或MODE_GATORLIPS
shift - 位移數
double jaw_val=iAlligator(NULl, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_GATORJAW, 1);
double iADX( string symbol, int timeframe, int period, int applied_price, int mode, int shift)
計算 Movement directional index 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
applied_price - 應用價格類型
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
if(iADX(NULL,0,14,PRICE_HIGH,MODE_MAIN,0)>iADX(NULL,0,14,PRICE_HIGH,MODE_PLUSDI,0)) return(0);
double iATR( string symbol, int timeframe, int period, int shift)
計算 Indicator of the average true range 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
shift - 位移數
if (iATR(NULL,0,12,0)>iATR(NULL,0,20,0)) return(0);
double iAO( string symbol, int timeframe, int shift)
計算 Bill Williams' Awesome oscillator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
double val=iAO(NULL, 0, 2);
double iBearsPower( string symbol, int timeframe, int period, int applied_price, int shift)
計算 Bears Power indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
applied_price - 應用價格類型
shift - 位移數
double val=iBearsPower(NULL, 0, 13,PRICE_CLOSE,0);
double iBands( string symbol, int timeframe, int period, int deviation, int bands_shift, int applied_price, int mode, int shift)
計算 Bollinger bands indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
deviation - 背離
bands_shift - Bands位移
applied_price - 應用價格類型
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
if(iBands(NULL,0,20,2,0,PRICE_LOW,MODE_LOWER,0)>Low[0]) return(0);
double iBandsOnArray( double array[], int total, int period, double deviation, int bands_shift, int mode, int shift)
從數組中計算 Bollinger bands indicator 的值
:: 輸入參數
array[] - 數組數據
total - 總數據數量
period - 週期
deviation - 背離
bands_shift - Bands位移
applied_price - 應用價格類型
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
if(iBands(NULL,0,20,2,0,PRICE_LOW,MODE_LOWER,0)>Low[0]) return(0);
double iBullsPower( string symbol, int timeframe, int period, int applied_price, int shift)
計算 Bulls Power indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
applied_price - 應用價格類型
shift - 位移數
double val=iBullsPower(NULL, 0, 13,PRICE_CLOSE,0);
double iCCI( string symbol, int timeframe, int period, int applied_price, int shift)
計算 Commodity channel index 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
applied_price - 應用價格類型
shift - 位移數
if(iCCI(NULL,0,12,0)>iCCI(NULL,0,20,0)) return(0);
double iCCIOnArray( double array[], int total, int period, int shift)
從數組中計算 Commodity channel index 的值
:: 輸入參數
array[] - 數組數據
total - 總數據數量
period - 週期
shift - 位移數
if(iCCIOnArray(ExtBuffer,total,12,0)>iCCI(NULL,0,20,PRICE_OPEN, 0)) return(0);
double iCustom( string symbol, int timeframe, string name, ... , int mode, int shift)
計算 自定義指標 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
name - 自定義指標名稱
... - 自定義指標參數
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
double val=iCustom(NULL, 0, "SampleInd",13,1,0);
double iDeMarker( string symbol, int timeframe, int period, int shift)
計算 DeMarker indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
shift - 位移數
double val=iDeMarker(NULL, 0, 13, 1);
double iEnvelopes( string symbol, int timeframe, int ma_period, int ma_method, int ma_shift, int applied_price, double deviation, int mode, int shift)
計算 Envelopes indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
ma_period - 移動平均線週期
ma_method - 移動平均線模式
ma_shift - 移動平均線位移
applied_price - 應用價格類型
deviation - 背離
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
double val=iEnvelopes(NULL, 0, 13,MODE_SMA,10,PRICE_CLOSE,0.2,MODE_UPPER,0);
double iEnvelopesOnArray( double array[], int total, int ma_period, int ma_method, int ma_shift, double deviation, int mode, int shift)
從數組中計算 Envelopes indicator 的值
:: 輸入參數
array[] - 數組數據
total - 總數據數量
ma_period - 移動平均線週期
ma_method - 移動平均線模式
ma_shift - 移動平均線位移
deviation - 背離
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
double val=iEnvelopesOnArray(ExtBuffer, 0, 13, MODE_SMA, 0.2, MODE_UPPER,0 );
double iForce( string symbol, int timeframe, int period, int ma_method, int applied_price, int shift)
計算 Force index 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
ma_method - 移動平均線模式
applied_price - 應用價格類型
shift - 位移數
double val=iForce(NULL, 0, 13,MODE_SMA,PRICE_CLOSE,0);
double iFractals( string symbol, int timeframe, int mode, int shift)
計算 Fractals 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
double val=iFractals(NULL, 0, MODE_UPPER,0);
double iGator( string symbol, int timeframe, int jaw_period, int jaw_shift, int teeth_period, int teeth_shift, int lips_period, int lips_shift, int ma_method, int applied_price, int mode, int shift)
計算 Fractals 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
jaw_period - 顎線週期
jaw_shift - 顎線位移
teeth_period - 齒線週期
teeth_shift - 齒線位移
lips_period - 唇線週期
lips_shift - 唇線位移
ma_method - 移動平均線種類
applied_price - 應用價格類型
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
double jaw_val=iGator(NULL, 0, 13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN, MODE_UPPER, 1);
double iIchimoku( string symbol, int timeframe, int tenkan_sen, int kijun_sen, int senkou_span_b, int mode, int shift)
計算 Ichimoku Kinko Hyo 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
tenkan_sen - 轉換線
jkijun_sen - 基準線
senkou_span_b - 參考範圍b
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
double tenkan_sen=iIchimoku(NULL, 0, 9, 26, 52, MODE_TENKANSEN, 1);
double iBWMFI( string symbol, int timeframe, int shift)
計算 Bill Williams Market Facilitation index 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
double val=iBWMFI(NULL, 0, 0);
double iMomentum( string symbol, int timeframe, int period, int applied_price, int shift)
計算 Momentum indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
applied_price - 應用價格類型
shift - 位移數
if(iMomentum(NULL,0,12,PRICE_CLOSE,0)>iMomentum(NULL,0,20,PRICE_CLOSE,0)) return(0);
double iMomentumOnArray( double array[], int total, int period, int shift)
從數組中計算 Momentum indicator 的值
:: 輸入參數
array[] - 數組數據
total - 總數據數量
period - 週期
shift - 位移數
if(iMomentumOnArray(mybuffer,100,12,0)>iMomentumOnArray(mubuffer,100,20,0)) return(0);
double iMFI( string symbol, int timeframe, int period, int shift)
計算 Money flow index 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
shift - 位移數
if(iMFI(NULL,0,14,0)>iMFI(NULL,0,14,1)) return(0);
double iMA( string symbol, int timeframe, int period, int ma_shift, int ma_method, int applied_price, int shift)
計算 Moving average indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
ma_shift - 移動平均線位移
ma_method - 移動平均線模式
applied_price - 應用價格類型
shift - 位移數
AlligatorJawsBuffer[i]=iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);
double iMAOnArray( double array[], int total, int period, int ma_shift, int ma_method, int shift)
從數組中計算 Moving average indicator 的值
:: 輸入參數
array[] - 數組數據
total - 總數據數量
period - 週期
ma_shift - 移動平均線位移
ma_method - 移動平均線模式
shift - 位移數
double macurrent=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,0);
double macurrentslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,0);
double maprev=iMAOnArray(ExtBuffer,0,5,0,MODE_LWMA,1);
double maprevslow=iMAOnArray(ExtBuffer,0,10,0,MODE_LWMA,1);
//----
if(maprev=macurrentslow)
Alert("crossing up");
double iOsMA( string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int shift)
計算 Moving Average of Oscillator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
fast_ema_period - 快均線週期
slow_ema_period - 慢均線週期
signal_period - 信號週期
applied_price - 應用價格類型
shift - 位移數
if(iOsMA(NULL,0,12,26,9,PRICE_OPEN,1)>iOsMA(NULL,0,12,26,9,PRICE_OPEN,0)) return(0);
double iMACD( string symbol, int timeframe, int fast_ema_period, int slow_ema_period, int signal_period, int applied_price, int mode, int shift)
計算 Moving averages convergence/divergence 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
fast_ema_period - 快均線週期
slow_ema_period - 慢均線週期
signal_period - 信號週期
applied_price - 應用價格類型
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
if(iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0)) return(0);
double iOBV( string symbol, int timeframe, int applied_price, int shift)
計算 On Balance Volume indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
shift - 位移數
double val=iOBV(NULL, 0, PRICE_CLOSE, 1);
double iSAR( string symbol, int timeframe, double step, double maximum, int shift)
計算 On Balance Volume indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
step - 步幅
maximum - 最大值
shift - 位移數
if(iSAR(NULL,0,0.02,0.2,0)>Close[0]) return(0);
double iRSI( string symbol, void timeframe, int period, int applied_price, int shift)
計算 Relative strength index 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
applied_price - 應用價格類型
shift - 位移數
if(iRSI(NULL,0,14,PRICE_CLOSE,0)>iRSI(NULL,0,14,PRICE_CLOSE,1)) return(0);
double iRSIOnArray( double array[], int total, int period, int shift)
從數組中計算 Relative strength index 的值
:: 輸入參數
array[] - 數組數據
total - 總數據數量
period - 週期
shift - 位移數
if(iRSIOnBuffer(ExtBuffer,1000,14,0)>iRSI(NULL,0,14,PRICE_CLOSE,1)) return(0);
double iRVI( string symbol, int timeframe, int period, int mode, int shift)
計算 Relative Vigor index 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
double val=iRVI(NULL, 0, 10,MODE_MAIN,0);
double iStdDev( string symbol, int timeframe, int ma_period, int ma_method, int ma_shift, int applied_price, int shift)
計算 Standard Deviation indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
ma_period - 移動平均線週期
ma_method - 移動平均線模式
ma_shift - 移動平均線位移
applied_price - 應用價格類型
shift - 位移數
double val=iStdDev(NULL,0,10,MODE_EMA,0,PRICE_CLOSE,0);
double iStdDevOnArray( double array[], int total, int ma_period, int ma_method, int ma_shift, int shift)
從數組中計算 Standard Deviation indicator 的值
:: 輸入參數
array[] - 數組數據
total - 總數據數量
ma_period - 移動平均線週期
ma_method - 移動平均線模式
ma_shift - 移動平均線位移
shift - 位移數
double val=iStdDevOnArray(ExtBuffer,100,10,MODE_EMA,0,0);
double iStochastic( string symbol, int timeframe, int %Kperiod, int %Dperiod, int slowing, int method, int price_field, int mode, int shift)
計算 Stochastic oscillator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
%Kperiod - %K線週期
%Dperiod - %D線週期
slowing - 減速量
method - 移動平均線種類
price_field - 價格領域參數: 0 - Low/High or 1 - Close/Close.
mode - 來源模式,參見指標線分類枚舉
shift - 位移數
if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0))
return(0);
double iWPR( string symbol, int timeframe, int period, int shift)
計算 Larry William's percent range indicator 的值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
period - 週期
shift - 位移數
if(iWPR(NULL,0,14,0)>iWPR(NULL,0,14,1)) return(0);
int iBars( string symbol, int timeframe)
返回制定圖表的數據數
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
Print("Bar count on the 'EUROUSD' symbol with PERIOD_H1 is",iBars("EUROUSD",PERIOD_H1));
int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)
在制定圖表中搜索數據
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
time - 時間
exact - 是否精確的
datetime some_time=D'2004.03.21 12:00';
int shift=iBarShift("EUROUSD",PERIOD_M1,some_time);
Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift);
double iClose( string symbol, int timeframe, int shift)
返回制定圖表的收盤價
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,i),", ", iOpen("USDCHF",PERIOD_H1,i),", ",
iHigh("USDCHF",PERIOD_H1,i),", ", iLow("USDCHF",PERIOD_H1,i),", ",
iClose("USDCHF",PERIOD_H1,i),", ", iVolume("USDCHF",PERIOD_H1,i));
返回制定圖表的最高價
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,i),", ", iOpen("USDCHF",PERIOD_H1,i),", ",
iHigh("USDCHF",PERIOD_H1,i),", ", iLow("USDCHF",PERIOD_H1,i),", ",
iClose("USDCHF",PERIOD_H1,i),", ", iVolume("USDCHF",PERIOD_H1,i));
double iLow( string symbol, int timeframe, int shift)
返回制定圖表的最低價
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,i),", ", iOpen("USDCHF",PERIOD_H1,i),", ",
iHigh("USDCHF",PERIOD_H1,i),", ", iLow("USDCHF",PERIOD_H1,i),", ",
iClose("USDCHF",PERIOD_H1,i),", ", iVolume("USDCHF",PERIOD_H1,i));
double iOpen( string symbol, int timeframe, int shift)
返回制定圖表的開盤價
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,i),", ", iOpen("USDCHF",PERIOD_H1,i),", ",
iHigh("USDCHF",PERIOD_H1,i),", ", iLow("USDCHF",PERIOD_H1,i),", ",
iClose("USDCHF",PERIOD_H1,i),", ", iVolume("USDCHF",PERIOD_H1,i));
datetime iTime( string symbol, int timeframe, int shift)
返回制定圖表的時間
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,i),", ", iOpen("USDCHF",PERIOD_H1,i),", ",
iHigh("USDCHF",PERIOD_H1,i),", ", iLow("USDCHF",PERIOD_H1,i),", ",
iClose("USDCHF",PERIOD_H1,i),", ", iVolume("USDCHF",PERIOD_H1,i));
double iVolume( string symbol, int timeframe, int shift)
返回制定圖表的成交量
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
shift - 位移數
Print("Current bar for USDCHF H1: ",iTime("USDCHF",PERIOD_H1,i),", ", iOpen("USDCHF",PERIOD_H1,i),", ",
iHigh("USDCHF",PERIOD_H1,i),", ", iLow("USDCHF",PERIOD_H1,i),", ",
iClose("USDCHF",PERIOD_H1,i),", ", iVolume("USDCHF",PERIOD_H1,i));
int Highest( string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)
返回制定圖表的某段數據的最高值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
type - 數據類型
count - 計算範圍
start - 開始點
double val;
// calculating the highest value in the range from 5 element to 25 element
// indicator charts symbol and indicator charts time frame
val=High[Highest(NULL,0,MODE_HIGH,20,4)];
int Lowest( string symbol, int timeframe, int type, int count=WHOLE_ARRAY, int start=0)
返回制定圖表的某段數據的最高值
:: 輸入參數
symbol - 通貨標識
timeframe - 時間線
type - 數據類型
count - 計算範圍
start - 開始點
double val=Low[Lowest(NULL,0,MODE_LOW,10,10)];
感謝您的閱讀!
微博: