混沌操作法——第一智者MT4源码http://blog.sina.com.cn/s/blog_62f6a62b0100gmc8.html//+------------------------------------------------------------------+//|BW-wiseMan-1.mq4|//|Copyright?2005,wellx|//|http://www.metaquotes.net|//+------------------------------------------------------------------+#propertycopyright"Copyright?2005,wellx"#propertylink"http://www.metaquotes.net"#propertyindicator_chart_window#propertyindicator_buffers2#propertyindicator_color1Yellow#propertyindicator_color2OrangeRedexternintupdown=5;externintback=2;//----buffersdoubleBWWM1Up[];doubleBWWM1Down[];intpos=0;inti=0;boolcontup=true,contdown=true;//+-----------------------------------------------------------------+//|Customindicatorinitializationfunction|//+------------------------------------------------------------------+intinit(){//----indicatorsSetIndexStyle(0,DRAW_ARROW);SetIndexArrow(0,140);SetIndexBuffer(0,BWWM1Up);SetIndexEmptyValue(0,0.0);SetIndexStyle(1,DRAW_ARROW);SetIndexArrow(1,140);SetIndexBuffer(1,BWWM1Down);SetIndexEmptyValue(1,0.0);IndicatorDigits(6);//----return(0);}//+------------------------------------------------------------------+//|Custorindicatordeinitializationfunction|//+------------------------------------------------------------------+intdeinit(){//----TODO:addyourcodehere//----return(0);}//+------------------------------------------------------------------+//|Customindicatoriterationfunction|//+------------------------------------------------------------------+intstart(){intcbars=IndicatorCounted();if(cbars<0)return(-1);if(cbars>0)cbars--;//----TODO:addyourcodehere//if(cbars==0)return(0);pos=cbars;while(pos>0){BWWM1Up[pos]=NULL;BWWM1Down[pos]=NULL;if((Low[pos]>iAlligator(NULL,0,13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORLIPS,pos))&&(Low[pos]>iAlligator(NULL,0,13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORTEETH,pos))&&(Low[pos]>iAlligator(NULL,0,13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,MODE_GATORJAW,pos))&&(Close[pos]<((High[pos]+Low[pos])/2))){contup=true;for(i=1;i<=back;i++){if(High[pos]<=High[pos+i]){contup=false;break;}}if(contup)BWWM1Up[pos]=(High[pos]+updown*Point);}if((High[pos]((High[pos]+Low[pos])/2))){contdown=true;for(i=1;i<=back;i++){if(Low[pos]>=Low[pos+i]){contdown=false;break;}}if(contdown)BWWM1Down[pos]=(Low[pos]-updown*Point);}pos--;}//----return(0);}//+------------------------------------------------------------------+