Probability Density Function (PDF)
//+------------------------------------------------------------------+
//| PDF.mq4 |
//| Copyright ?2006, Luis Guilherme Damiani |
//| http://www.damianifx.com.br |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, Luis Guilherme Damiani"
#property link "http://www.damianifx.com.br"
//----
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 MediumSeaGreen
//----
double pdf[];
//---- input parameters
extern int ch_size=20;
//extern int limit_value=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,pdf);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
//---- indicators
int counter;
int totBars=Bars;
int value=0;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
ArrayInitialize(counter,0);
for(int i =Bars-1-ch_size;i>=0;i--)
{
value=MathCeil(iStochastic(NULL,0,ch_size, 2,1,MODE_SMA,0,MODE_MAIN,i));
counter=counter+1;
//if(counter>limit_value && limit_value!=0)counter=limit_value;
}
pdf=0;
for(i=100;i>0;i--)
{
pdf=counter;
// Print(pdf);
}
//----
return(0);
}
//+------------------------------------------------------------------+
难得一见的好帖 学习了,不错,讲的太有道理了 难得一见的好帖 学习了,不错 谢谢楼主分享 谢谢楼主分享 {:1_181:} 谢谢 支持下
页:
[1]
2