rushiguan
发表于 2019-2-6 09:11:17
3333333333
huwenxue
发表于 2019-2-6 14:55:16
金手指指标,没有未来
我是我123456
发表于 2019-2-6 15:03:51
111111111111111111
myra
发表于 2019-2-6 19:20:04
xxxxxxxxxxxxxxx
1tianshuang1
发表于 2019-2-7 01:26:56
是不啊,很厉害吗?
何万天
发表于 2019-2-7 06:42:44
66666666666互相学习
123546021
发表于 2019-2-7 06:56:02
//+------------------------------------------------------------------+
//| MACD with crossing.mq4 |
//| Copyright @2004, MetaQuotes Software Corp. |
//+------------------------------------------------------------------+
#property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
#property link "http://www.eazhijia.com"
#property strict
#propertyindicator_separate_window
#propertyindicator_buffers 3
#propertyindicator_color1Gold
#propertyindicator_color2Red
#propertyindicator_color3Gray
#propertyindicator_width12
input int FastEMA=12;
input int SlowEMA=26;
input int SignalSMA=9;
double MacdBuffer[];
double SignalBuffer[];
double HistogramBuffer[];
int maxLines;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit(void)
{
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexBuffer(0,MacdBuffer);
SetIndexBuffer(1,SignalBuffer);
SetIndexBuffer(2,HistogramBuffer);
SetIndexLabel(0,"MACD");
SetIndexLabel(1,"Signal");
SetIndexLabel(2,"MACD-Signal");
SetIndexDrawBegin(1,SignalSMA);
IndicatorDigits(Digits+1);
IndicatorShortName("MACD("+IntegerToString(FastEMA)+","+IntegerToString(SlowEMA)+","+IntegerToString(SignalSMA)+")");
return(0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
DeleteLines();
Comment("www.eazhijia.com");
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,
const int prev_calculated,
const datetime& time[],
const double& open[],
const double& high[],
const double& low[],
const double& close[],
const long& tick_volume[],
const long& volume[],
const int& spread[])
{
double crossing;
int limit,i;
int counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i=0; i<limit; i++) MacdBuffer=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);
for(i=0; i<limit; i++)
{
SignalBuffer=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);
HistogramBuffer=MacdBuffer - SignalBuffer;
}
DeleteLines();
for(i=WindowBarsPerChart(); i>0 ;i--)
{
crossing=(MacdBuffer-SignalBuffer)*(MacdBuffer-SignalBuffer);
if (crossing < 0)
{
maxLines+=1;
ObjectCreate("MacdCross"+IntegerToString(maxLines),0,0,Time,0);
ObjectSet("MacdCross"+IntegerToString(maxLines),OBJPROP_COLOR,DimGray);
ObjectSet("MacdCross"+IntegerToString(maxLines),OBJPROP_STYLE,STYLE_DOT);
}
}
return(rates_total);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void DeleteLines()
{
for(int i=1;i<=maxLines;i++) ObjectDelete("MacdCross"+IntegerToString(i)); maxLines=0;
}
//+------------------------------------------------------------------+
复制代码
zhdzpl
发表于 2019-2-7 07:55:40
阿斯顿法国红酒看
460666883
发表于 2019-2-7 16:05:36
谢谢分享谢谢
191885050
发表于 2019-2-7 16:10:13
谢谢分享学习下