int limit, shift;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
if (bufferLadder[shift]>bufferLadder[shift+1]) bufferDirection[shift] = 1.0;
if (bufferLadder[shift]<bufferLadder[shift+1]) bufferDirection[shift] = -1.0;
if (bufferLadder[shift]==bufferLadder[shift+1]) bufferDirection[shift] = bufferDirection[shift+1];
if (bufferDirection[shift]>0.0) bufferUp[shift]=bufferLadder[shift]-Point*2;
if (bufferDirection[shift]<0.0) bufferDn[shift]=bufferLadder[shift]+Point*2;
}
/// Alert Process
if (bufferDirection[1]!=bufferDirection[2] && dtLastTime!=Time[0])
{
if (窗口提示==A)
Alert(strAlertMessage);
if (声音提示==A)
PlaySound("alert.wav");
if (电邮通知==A)
SendMail(strAlertMessage,
"Current Price "+DoubleToStr(Close[0],Digits)+
"\nTime: " + TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS)
+ "\nLast Day Close: " + DoubleToStr(dLastDayClose,Digits)
+ "\nChange: " + DoubleToStr(dUpDnPercent,2) + "%");
if (手机MT4通知==A)
SendNotification(strAlertMessage);
}
}
return(0);
}
string PeriodToString (int imin)
{
string strprd;
switch (imin)
{
case (1):
strprd="M1";
break;
case (2):
strprd="M2";
break;
case (3):
strprd="M3";
break;
case (5):
strprd="M5";
break;
case (15):
strprd="M15";
break;
case (30):
strprd="M30";
break;
case (60):
strprd="H1";
break;
case (60*4):
strprd="H4";
break;
case (60*24):
strprd="D1";
break;
case (60*24*7):
strprd="W1";
break;
}
return (strprd);
}作者: 朱守正 时间: 2019-11-14 20:08
另一个是TrendMagic
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 Black
#property indicator_color4 Black
extern int CCPeriod = 50;
extern int ATRPeriod = 5;
double g_ibuf_76[];
double g_ibuf_80[];
int gi_84 = 0;