求助:哪位达人请帮忙加个提醒功能吧!谢谢!
//+------------------------------------------------------------------+
//| SilverTrend .mq4 |
//| SilverTrend rewritten by CrazyChart |
//| http://viac.ru/ |
//+------------------------------------------------------------------+
#property copyright "SilverTrend rewritten by CrazyChart"
#property link "http://viac.ru/ "
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- input parameters
extern int CountBars=300;
extern int SSP=7;
extern double Kmin=1.6;
extern double Kmax=50.6; //24 21.6 21.6
//---- buffers
double ExtMapBuffer1;
double ExtMapBuffer2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_LINE,0,2,Red);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE,0,2,Blue);
SetIndexBuffer(1,ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
if (CountBars>=Bars) CountBars=Bars;
SetIndexDrawBegin(0,Bars-CountBars+SSP);
SetIndexDrawBegin(1,Bars-CountBars+SSP);
int i, i2,loopbegin,counted_bars=IndicatorCounted();
double SsMax, SsMin, K, val1, val2, smin, smax, price;
if(Bars<=SSP+1) return(0);
//---- initial zero
//K=33-RISK;
/*
if (firstTime==true) {
loopbegin = CountBars;
if (loopbegin>(Bars-2*SSP+1)) loopbegin=Bars-2*SSP+1;
firstTime=False;
}; 痼滂戾眚 耱囵铋 镳钽疣祆?
*/
if(Bars<=SSP+1) return(0);
//---- initial zero
//+++++++
if(counted_bars=0;i--) {
SsMax = High[Highest(NULL,0,MODE_HIGH,SSP,i-SSP+1)];
SsMin = Low[Lowest(NULL,0,MODE_LOW,SSP,i-SSP+1)];
smin = SsMin-(SsMax-SsMin)*Kmin/100;
smax = SsMax-(SsMax-SsMin)*Kmax/100;
ExtMapBuffer1[i-SSP+6]=smax;
ExtMapBuffer2[i-SSP-1]=smax;
val1 = ExtMapBuffer1[0];
val2 = ExtMapBuffer2[0];
if (val1 > val2) Comment("buy ",val1);
if (val1 < val2) Comment("sell ",val2);
}
//----
return(0);
}
//+------------------------------------------------------------------+
上面是代码,希望当上一时段双线发生交叉时,在这一时段开始时发出报警。从来没编过程,也想自己试试,但实在是摸不到头脑。先谢谢了!
2楼
没人肯帮忙吗?自己顶一下!:')
达则兼济天下
穷则独善其身
发表于:2007-05-17 10:41只看该作者
3楼
既然没高手肯帮忙,那我就用三脚猫的功夫帮你一把(因为我不是学软件的:lol ),你自己去试试,有问题再说SilverTrend.mq4
www.talkforex.com/blog//index.php?action/space/uid/39428
4楼
谢谢爆爆熊,最热心的就数爆爆熊了,非常感谢!
达则兼济天下
穷则独善其身
发表于:2007-05-19 14:37只看该作者
5楼
原帖由 grant525 于 2007-5-17 21:26 发表 谢谢爆爆熊,最热心的就数爆爆熊了,非常感谢!
www.talkforex.com/blog//index.php?action/space/uid/39428