求解析程式容
各位大大好: 本人在其他中找到,1段程式,想把它改成VT程式,但本人MT4程式不懂,可否高手忙用白解析以下各程式之作用,或有人可直接它改成VT程式,惑激不! //+------------------------------------------------------------------+ //| PriceChannel_Stop_v1 | //+------------------------------------------------------------------+ int start() { int i,shift,trend; double high, low, price; double smax[5000],smin[5000],bsmax[5000],bsmin[5000]; for (shift=Nbars-1;shift>=0;shift--) { UpTrendBuffer[shift]=EMPTY_VALUE; DownTrendBuffer[shift]=EMPTY_VALUE; UpTrendSignal[shift]=EMPTY_VALUE; DownTrendSignal[shift]=EMPTY_VALUE; UpTrendLine[shift]=EMPTY_VALUE; DownTrendLine[shift]=EMPTY_VALUE; } for (shift=Nbars-ChannelPeriod-1;shift>=0;shift--) { high=High[shift]; low=Low[shift]; i=shift-1+ChannelPeriod; while(i>=shift) { price=High<i>; if(highprice) low=price; i--; } smax[shift]=high; smin[shift]=low; bsmax[shift]=smax[shift]-(smax[shift]-smin[shift])*Risk; bsmin[shift]=smin[shift]+(smax[shift]-smin[shift])*Risk; if (Close[shift]>bsmax[shift+1]) trend=1; if (Close[shift]0 && bsmin[shift]0) { if (Signal>0 && UpTrendBuffer[shift+1]==-1.0) { UpTrendSignal[shift]=bsmin[shift]; if(Line>0) UpTrendLine[shift]=bsmin[shift]; } else { UpTrendBuffer[shift]=bsmin[shift]; if(Line>0) UpTrendLine[shift]=bsmin[shift]; UpTrendSignal[shift]=-1; } if (Signal==2) UpTrendBuffer[shift]=0; DownTrendBuffer[shift]=-1.0; DownTrendLine[shift]=EMPTY_VALUE; } if (trend0 && DownTrendBuffer[shift+1]==-1.0) { DownTrendSignal[shift]=bsmax[shift]; if(Line>0) DownTrendLine[shift]=bsmax[shift]; } else { DownTrendBuffer[shift]=bsmax[shift]; if(Line>0)DownTrendLine[shift]=bsmax[shift]; DownTrendSignal[shift]=-1; } if (Signal==2) DownTrendBuffer[shift]=0; UpTrendBuffer[shift]=-1.0; UpTrendLine[shift]=EMPTY_VALUE; } } return(0); } //+------------------------------------------------------------------+[/td][/tr] |
打赏
最新创建圈子
- 新闻EA运行效果图圈 2019-05-05
圈主:admin 帖子:1