交易筑基吧 关注:9贴子:30
  • 0回复贴,共1

【mt4源码】一个简单的超买超卖指标

取消只看楼主收藏回复

这个指标,加载到 黄金,五分钟图表。
超买超卖判断依据是现价离均线的距离,我用了SMMA45,实际上和EMA90基本重合。所以,很多技术大致差不离就行,模糊理论才是王道。
黄箭头表示小级别,红箭头表示中级别。

//+------------------------------------------------------------------+
//| ArrowMA.mq4 |
//+------------------------------------------------------------------+
#property copyright "talong777e"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 clrRed
#property indicator_color2 clrRed
#property indicator_color3 clrYellow
#property indicator_color4 clrYellow
double BuffersUp[];
double BuffersDown[];
double BuffersMidUp[];
double BuffersMidDown[];
input int dis = 20;
input int mid = 10;
int OnInit(void)
{
IndicatorBuffers(2);
IndicatorDigits(Digits);
SetIndexBuffer(0,BuffersUp);
SetIndexStyle(0,DRAW_ARROW,0,2);
SetIndexArrow(0,233);
SetIndexBuffer(1,BuffersDown);
SetIndexStyle(1,DRAW_ARROW,0,2);
SetIndexArrow(1,234);
SetIndexBuffer(2,BuffersMidUp);
SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,233);
SetIndexBuffer(3,BuffersMidDown);
SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow(3,234);
return(INIT_SUCCEEDED);
}
int start()
{
for(int i=0; i<Bars; i++)
{
BuffersUp[i] = (Close[i] < iMA(NULL, 0, 45, 0, MODE_SMMA, PRICE_TYPICAL, i)-dis) ? Low[i]-1 : NULL;
BuffersDown[i] = (Close[i] > iMA(NULL, 0, 45, 0, MODE_SMMA, PRICE_TYPICAL, i)+dis) ? High[i]+1 : NULL;
BuffersMidUp[i] = (Close[i] < iMA(NULL, 0, 45, 0, MODE_SMMA, PRICE_TYPICAL, i)-mid) ? Low[i]-0.5 : NULL;
BuffersMidDown[i] = (Close[i] > iMA(NULL, 0, 45, 0, MODE_SMMA, PRICE_TYPICAL, i)+mid) ? High[i]+0.5 : NULL;
}
return(0);
}


1楼2024-07-22 15:10回复