发表于:2005-07-28 02:49只看该作者
2楼
韬客社区www.talkfx.co
3楼
多谢楼上,可是它和我的还是有点不一样,他的零轴以上都是红柱,零轴以下都是绿柱.而我的是如果大于前一根柱线则为红的,否则为绿的.
韬客社区www.talkfx.co
发表于:2005-07-28 04:22只看该作者
4楼
这个容易,就在rick_321基础上面改好了。
//+------------------------------------------------------------------+
//| BENBEN-MACD.mq4 |
//| Copyright ?2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 White
#property indicator_color3 Red
#property indicator_color4 Green
//int indicator_color3;
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
//---- indicator buffers
double ind_buffer1;
double ind_buffer2;
double ind_buffer3;
double ind_buffer4;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
SetIndexDrawBegin(1,SignalSMA);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
//---- indicator buffers mapping
if(!SetIndexBuffer(0,ind_buffer1) && !SetIndexBuffer(1,ind_buffer2)&& !SetIndexBuffer(2,ind_buffer3)&& !SetIndexBuffer(3,ind_buffer4))
Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");
SetIndexLabel(0,"MACD");
SetIndexLabel(1,"Signal");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
double temp,temp1;
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; itemp1) {ind_buffer3=temp;ind_buffer4=0;}
else {ind_buffer3=0;ind_buffer4=temp;}
}
//---- done
return(0);
}
发表于:2005-07-28 06:07只看该作者
5楼
是不是这样的未命名.GIF
韬客社区www.talkfx.co
发表于:2005-07-28 06:09只看该作者
6楼
哈哈,楼上的兄弟比我快
以后有问题还得多向您请教
:handshake
[ 本帖最后由 rick_321 于 2005-7-28 14:16 编辑 ]
韬客社区www.talkfx.co
7楼
太好了,多谢各位的帮助.
韬客社区www.talkfx.co
发表于:2006-04-28 04:32只看该作者
8楼
hawkie 兄
请教我想只要两条线交叉,不要MACD棒线的
去掉那行啊?
谢谢!
以戒为师摄心为戒因戒生定因定发慧欲思其利必虑其害轻仓顺势止损
发表于:2006-04-28 06:31只看该作者
9楼
用MT4中的MACD,然后加一个MA1刻画一下柱状线的边,就可以
韬客社区www.talkfx.co
发表于:2006-04-28 06:42只看该作者
12楼
这是一位网友(忘了在哪看见的,抱歉)写的两条线的MACD
//+------------------------------------------------------------------+
//| mc.mq4 |
//| Copyright ?2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
//---- indicator parameters
extern int FastEMA=12;
extern int SlowEMA=26;
extern int SignalSMA=9;
extern int EnableAlerts=1;
//---- indicator buffers
double ind_buffer1;
double ind_buffer2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
SetIndexDrawBegin(1,SignalSMA);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+1);
//---- indicator buffers mapping
if(!SetIndexBuffer(0,ind_buffer1) && !SetIndexBuffer(1,ind_buffer2))
Print("cannot set indicator buffers!");
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");
SetIndexLabel(0,"MACD");
SetIndexLabel(1,"Signal");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=0; i
韬客社区www.talkfx.co
发表于:2006-04-28 06:45只看该作者
13楼
谢谢fx007 的回复
我想不显示柱状线,看着眼花。
以戒为师摄心为戒因戒生定因定发慧欲思其利必虑其害轻仓顺势止损
发表于:2006-04-28 07:33只看该作者
14楼
把柱状线变成与背景一致的颜色
韬客社区www.talkfx.co
发表于:2006-09-29 12:11只看该作者
17楼
原帖由 fx007 于 2006-4-28 15:33 发表 把柱状线变成与背景一致的颜色
韬客社区www.talkfx.co
发表于:2006-09-29 12:12只看该作者
18楼
原帖由 大毛 于 2006-9-28 21:46 发表 请教如何使MACD的柱线为上升是红而下降为绿呢.......
韬客社区www.talkfx.co
发表于:2006-11-02 09:59只看该作者
19楼
如果能在当前周期开始时,判别前一柱线已经变色,并发警报就好了
韬客社区www.talkfx.co
发表于:2008-12-18 12:55只看该作者
20楼
:D 这个指标这样看起来就方便多了啊 高手真是多
韬客社区www.talkfx.co