我所用的一个最简单的买卖指标(源码)
比率=((最高价-开盘价)+(收盘价-最低))/(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); } |
打赏
最新创建圈子
- 新闻EA运行效果图圈 2019-05-05
圈主:admin 帖子:1