呼唤风雨兄和高手们帮忙
风雨兄的MrBean用来做中长线趋势判断很好,我想用在中短线中,思路是这样的:
1、把MrBean用在副图中;
2、在MrBean中加入KDJ指标;
3、需要一条水平中间线。
请风雨兄和论坛里的高手们帮帮忙,非常感谢。
下面是风雨兄的MrBean的源代码,原贴在这个地址:http://www.talkforex.com/viewthread.php?tid=32261&extra=&page=1
//+------------------------------------------------------------------+
//| fxmacd |
//+------------------------------------------------------------------+
#property indicator_buffers 4
#property indicator_separate_window
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_color3 Silver
//---- buffers
double Buffer1;
double Buffer2;
double Buffer3;
extern int Fast = 12;
extern int Slow = 26;
extern int Signal = 9;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//IndicatorBuffers(4);
SetIndexStyle(0,DRAW_LINE,0,1);
SetIndexStyle(1,DRAW_LINE,0,1);
SetIndexStyle(2,DRAW_HISTOGRAM,0,1);
SetIndexBuffer(0,Buffer1);
SetIndexBuffer(1,Buffer2);
SetIndexBuffer(2,Buffer3);
IndicatorShortName("BillWin("+Fast+","+Slow+","+Signal+")");
IndicatorDigits(5);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//---- TODO: add your code here
for(int i=Bars;i>=0;i--){
Buffer1=iMACD(NULL,0,Fast,Slow,Signal,PRICE_CLOSE,MODE_MAIN,i);
Buffer2=iMACD(NULL,0,Fast,Slow,Signal,PRICE_CLOSE,MODE_SIGNAL,i);
Buffer3=Buffer1 - Buffer2;
}
//----
return(0);
}
//+------------------------------------------------------------------+