原帖由 zh1128 于 2007-10-31 16:45 发表
RSI有3条线7,14 ,28是怎样编写?在40以下14线上穿28;在60上方14线下穿28线;15,30,60分钟图都能报警;
RSI只需要一个参数,RSI(7,14,28)实际上是RSI(7)、RSI(14)、RSI(28)三个独立指标的组合
看楼主的意思,是要对RSI(14)、RSI(28)这两个指标交叉时报警。不过没关系,反正参数可以设置,想对任何参数交叉都可以报警的。
下面这个未经测试,试试再说
[CODE]
#property indicator_chart_window
extern int RSI1=14;
extern int RSI2=28;
int Alertmark=0;
int start()
{
if(Alertmark!=1 &&
iRSI(NULL,0,RSI2,PRICE_CLOSE,0)>=60 &&
iRSI(NULL,0,RSI1,PRICE_CLOSE,0)<=iRSI(NULL,0,RSI2,PRICE_CLOSE,0) &&
iRSI(NULL,0,RSI1,PRICE_CLOSE,2)> iRSI(NULL,0,RSI2,PRICE_CLOSE,2) )
{Alert(Symbol(),Period(),"60上方RSI(",RSI1,")下叉RSI(",RSI2,")"); Alertmark=1;}
if(Alertmark!=2 &&
iRSI(NULL,0,RSI2,PRICE_CLOSE,0)<=40 &&
iRSI(NULL,0,RSI1,PRICE_CLOSE,0)>=iRSI(NULL,0,RSI2,PRICE_CLOSE,0) &&
iRSI(NULL,0,RSI1,PRICE_CLOSE,2)< iRSI(NULL,0,RSI2,PRICE_CLOSE,2) )
{Alert(Symbol(),Period(),"40下方RSI(",RSI1,")上叉RSI(",RSI2,")"); Alertmark=2;}
return(0);
}
[/CODE]
如何导入指标,下面这里有介绍
http://www.talkforex.com/viewthread.php?tid=119502