您需要 登录 才可以下载或查看,没有帐号?注册
比率=((最高价-开盘价)+(收盘价-最低))/(2*范围)
Ratio=((High-Open)+(Close-Low))/(2*Range)
Rules for selling: a ratio of 64% or higher
卖出的法则: 当比率高于64% 卖出
Rules for buying: a ratio of 37% or lower
买入的法则: 当比率低于37% 买进
#define OB_RATIO 0.64 //sell signal, overbought
#define OS_RATIO 0.37 //buy signal, oversold
#define NORMAL_RATIO 0.5 //normal ratio
double dGetRatio(int iTimeframe, int iShift)
{
double dOpen, dHigh, dLow, dClose, dRatio=NORMAL_RATIO, dRange;
//Ratio=((High-Open)+(Close-Low))/(2*Range)
//Rules for selling: a ratio of 64% or higher
//Rules for buying: a ratio of 37% or lower
dOpen = iOpen(NULL,iTimeframe,iShift);
dHigh = iHigh(NULL,iTimeframe,iShift);
dLow = iLow(NULL,iTimeframe,iShift);
dClose = iClose(NULL,iTimeframe,iShift);
dRange = dHigh - dLow;
if( dRange 0 )
dRatio = ((dHigh-dOpen)+(dClose- dLow))/(2*dRange);
if( (dRatio 0.00001) || (dRatio 0.9999) ) dRatio = NORMAL_RATIO;
return (dRatio);
}
外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!