做外贸一般去什么网站找客户,视频网站后台设计,免费自己做网站手机软件,成都网站建设火狐狸完整EA#xff1a;Nerve Knife.ex4黄金交易策略_黄金趋势ea-CSDN博客
当大小趋势相同行情走向也相同#xff0c;就会开仓做顺势单#xff0c;并会顺势追单#xff0c;以达到快速止盈平仓的效果。大趋势追求稳定#xff0c;小趋势追求敏捷#xff0c;行情走向比小趋势更敏… 完整EANerve Knife.ex4黄金交易策略_黄金趋势ea-CSDN博客
当大小趋势相同行情走向也相同就会开仓做顺势单并会顺势追单以达到快速止盈平仓的效果。大趋势追求稳定小趋势追求敏捷行情走向比小趋势更敏捷所以做单原则是以大趋势方向为准小趋势作为行情判断的预判行情不对先冷静。代码如下
大趋势升M30 heiken ashi smoothed 指标为蓝色、macd 柱位于正区间、macd柱小于信号线
大趋势降M30 heiken ashi smoothed 指标为红色、macd 柱位于负区间、macd柱大于信号线
小趋势升M5 heiken ashi smoothed 指标为蓝色、macd柱小于信号线
小趋势降M5 heiken ashi smoothed 指标为红色、macd柱大于信号线
其它情况为趋势弱。代码如下
int checkHASDown(int timeFrame, int offset)
{int MaPeriod 6; double maOpen1timeFrame ! big_timeframe ? iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_OPEN,0) : iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_OPEN,1); double maClose1timeFrame ! big_timeframe ? iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_CLOSE,0) : iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_CLOSE,1) ; double maLow1timeFrame ! big_timeframe ? iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_LOW,0) : iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_LOW,1); double maHigh1timeFrame ! big_timeframe ? iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_HIGH,0) : iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_HIGH,1);double maOpen2timeFrame ! big_timeframe ? iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_OPEN,1 0) : iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_OPEN,1 1); double maClose2timeFrame ! big_timeframe ? iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_CLOSE,1 0) : iMA(NULL,timeFrame,MaPeriod,0,MODE_SMMA,PRICE_CLOSE,1 1);double haOpen1 (maOpen2 maClose2) / 2;double haClose1 (maOpen1 maClose1 maLow1 maHigh1) / 4; double MacdCurrent0timeFrame ! big_timeframe ? iMACD(NULL,timeFrame,12,26,9,PRICE_CLOSE,MODE_MAIN,0) : iMACD(NULL,timeFrame,12,26,9,PRICE_CLOSE,MODE_MAIN,1);double SignalCurrent0timeFrame ! big_timeframe ? iMACD(NULL,timeFrame,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0) : iMACD(NULL,timeFrame,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);double haHigh1MathMax(maHigh1,MathMax(haOpen1,haClose1)); double haLow1MathMin(maLow1,MathMin(haOpen1,haClose1));//6条30分k线内有一条出现8000点差判断为unknown避免影响指标判断。修正应该在线区间内才不做单。if(timeFrame big_timeframe){for(int i0;i6;i){int index iHighest(Symbol(),big_timeframe,MODE_HIGH,1,i);double highPrice iHigh(Symbol(), big_timeframe, index);index iLowest(Symbol(),big_timeframe,MODE_LOW,1,i);double lowPrice iLow(Symbol(), big_timeframe, index);if(highPrice - lowPrice 8 ((Ask lowPrice Ask highPrice) || (Bid highPrice Bid lowPrice)))//if(highPrice - lowPrice 8){printfPro(6条30分k线内出现过一条8刀的k线,并且当前行情在此区间内趋势的指标无法判断 , true);return UNKNOWN;}}}//增长无趋势时间,降低转换向前落单风险if(haOpen1haClose1 MacdCurrent0 SignalCurrent0){//printfPro(timeFrame : 1, 1);return UNKNOWN;}if(haOpen1haClose1 MacdCurrent0 SignalCurrent0){//printfPro(timeFrame : 1, 2);return UNKNOWN;}//使用MACD的辅助判断小趋势响应快大趋势保持稳定if(haOpen1haClose1 ((timeFrame ! big_timeframe) ? (MacdCurrent0 SignalCurrent0) : MacdCurrent0 0)){//printfPro(timeFrame : 1, 3);return DOWN; //下降}if (haClose1 haOpen1 ((timeFrame ! big_timeframe) ? (MacdCurrent0 SignalCurrent0) : MacdCurrent0 0)){//printfPro(timeFrame : 1, 4);return UP;//上升}//printfPro(timeFrame : 1, 5);return UNKNOWN;}
另外如下图关注实时价格变动如反向突破马上叫停开仓