[MT4指标]Advanced Get的OSC震荡指标MT源码
//+------------------------------------------------------------------+
//| OSC.mq4 |
//| Copyright ?2006,每天赚一点. |
//| http://www.talkforex.com |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006,每天赚一点."
#property link "http://www.talkforex.com"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_color3 Red
//---- buffers
double ExtMapBuffer1;
double ExtMapBuffer2;
double ExtMapBuffer3;
double ExtMapBuffer4;
double ExtMapBuffer5;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(5);
//---- 3 additional buffers are used for counting.
SetIndexBuffer(3, ExtMapBuffer4);
SetIndexBuffer(4, ExtMapBuffer5);
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
//----
int limit;
//---- 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;
//----
for(int i=0; i2) pos=Bars-counted_bars-1;
while(pos>=0)
{
if((pos==Bars-2))
{ ExtMapBuffer2[pos+1]=ExtMapBuffer1[pos+1];
ExtMapBuffer3[pos+1]=ExtMapBuffer1[pos+1];
}
if (ExtMapBuffer1[pos]>=0)
{
ExtMapBuffer2[pos]=ExtMapBuffer1[pos]*pr+ExtMapBuffer2[pos+1]*(1-pr);
ExtMapBuffer3[pos]=ExtMapBuffer3[pos+1];
}
else
{
ExtMapBuffer2[pos]=ExtMapBuffer2[pos+1];
ExtMapBuffer3[pos]=ExtMapBuffer1[pos]*pr+ExtMapBuffer3[pos+1]*(1-pr);
}
pos--;
}
//----
return(0);
}
//+------------------------------------------------------------------+Snap2.gif
发表于:2006-07-07 04:44只看该作者
2楼
你好,请问有Advanced Get的KD随机指数的源码吗?
韬客社区www.talkfx.co
发表于:2006-07-07 12:06只看该作者
3楼
'=' - left square parenthesis expected for array E:MetaTrader 4\experts\indicators\maosc.mq4 (68, 17)
mt4提示 出错 请楼主帮忙
韬客社区www.talkfx.co
发表于:2006-07-16 09:03只看该作者
5楼
谢谢 每天赚一点 发布 谢谢 zennchew 的改近 OSC震荡指标好用了
韬客社区www.talkfx.co