文档介绍:KDJ背离预警 MT4外汇指标
#property copyright "Copyright? 2010,"
#property indicator_separate_window #property indica---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,percentK);
SetIndexLabel(0, "%K");
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,percentD);
SetIndexLabel(1, "%D");
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,percentJ);
SetIndexLabel(2, "%J");
SetIndexBuffer(3,RSV);
SetIndexBuffer(4, UpperFr);
SetIndexBuffer(5, LowerFr);
//
SetIndexEmptyValue(4, 0);
SetIndexEmptyValue(5, 0);
//
SetIndexStyle(4, DRAW_ARROW);
SetIndexArrow(4, 241);
//
SetIndexStyle(5, DRAW_ARROW);
SetIndexArrow(5, 242);
//----
return(0);
}
//+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start()
{
int counted_bars=IndicatorCounted();
//----
int i, k, num;
double Ln, Hn, Cn;
//----
i = Bars - counted_bars - 1;
num = Bars - nPeriod;
while(i>=0)
{
Cn = iClose(NULL,0,i); Ln = iClose(NULL,0,i); Hn = iClose(NULL,0,i);
for(k=0; k<nPeriod; k+