2楼
rt
4楼
我上次不是说需要一个什么办法让某些技术指标达到某种状态的时候发出警报么,但是我不会,之后去问了官方网站,人家告诉我了解决方法,就是自己编一个技术指标,相当于自定义自述指标,和上次那个出现双线的macd一样,就是talkmacd,但是我不会用,生成了.mq4不知道怎么有,导入到mt4之后找不到这个新编的技术指标,原来需要重新启动一下mt4就行了,倒。太笨。。。半天才想到重新启动一下。。。。呵呵。
发表于:2005-03-31 00:11只看该作者
5楼
能发一个用用?谢谢!
韬客外汇论坛TALKFOREX.COM
6楼
Originally posted by yhxujm at 2005-3-31 08:11 能发一个用用?谢谢!
发表于:2005-03-31 02:48只看该作者
7楼
Originally posted by FireFox at 2005-3-31 08:49
遇到矛盾 先站在对方的立场上想想问题,先试着去理解别人
● 如何使用WinMTR查询平台连接流畅度
8楼
但是,不知道为什么,还是不响,感觉人家语句写的没错啊。
源程序:
//+------------------------------------------------------------------+
//| ADX X.mq4 |
//| Copyright ? 2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 MistyRose
#property indicator_color2 DeepPink
#property indicator_color3 GreenYellow
//---- input parameters
extern int ADXPeriod=14;
//---- buffers
double ADXBuffer;
double PlusDiBuffer;
double MinusDiBuffer;
double PlusSdiBuffer;
double MinusSdiBuffer;
double TempBuffer;
double PlusDiBufferCurrent=0;
double MinusDiBufferCurrent=0;
double PlusDiBufferPrevious=0;
double MinusDiBufferPrevious=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- 3 additional buffers are used for counting.
IndicatorBuffers(6);
//---- indicator buffers
SetIndexBuffer(0,ADXBuffer);
SetIndexBuffer(1,PlusDiBuffer);
SetIndexBuffer(2,MinusDiBuffer);
SetIndexBuffer(3,PlusSdiBuffer);
SetIndexBuffer(4,MinusSdiBuffer);
SetIndexBuffer(5,TempBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("ADX("+ADXPeriod+")");
SetIndexLabel(0,"ADX");
SetIndexLabel(1,"+DI");
SetIndexLabel(2,"-DI");
//----
SetIndexDrawBegin(0,ADXPeriod);
SetIndexDrawBegin(1,ADXPeriod);
SetIndexDrawBegin(2,ADXPeriod);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Average Directional Movement Index |
//+------------------------------------------------------------------+
int start()
{
double pdm,mdm,tr;
double price_high,price_low;
int starti,i,counted_bars=IndicatorCounted();
//----
i=Bars-2;
PlusSdiBuffer[i+1]=0;
MinusSdiBuffer[i+1]=0;
if(counted_bars>=i) i=Bars-counted_bars-1;
starti=i;
//----
while(i>=0)
{
price_low=Low;
price_high=High;
//----
pdm=price_high-High[i+1];
mdm=Low[i+1]-price_low;
if(pdm<0) pdm=0; // +DM
if(mdm<0) mdm=0; // -DM
if(pdm==mdm) { pdm=0; mdm=0; }
else if(pdm0) counted_bars--;
int limit=Bars-counted_bars;
//---- apply EMA to +DI
for(i=0; i<=limit; i++)
PlusDiBuffer=iMAOnArray(PlusSdiBuffer,Bars,ADXPeriod,0,MODE_EMA,i);
//---- apply EMA to -DI
for(i=0; i<=limit; i++)
MinusDiBuffer=iMAOnArray(MinusSdiBuffer,Bars,ADXPeriod,0,MODE_EMA,i);
//---- Directional Movement (DX)
i=Bars-2;
TempBuffer[i+1]=0;
i=starti;
while(i>=0)
{
double div=MathAbs(PlusDiBuffer+MinusDiBuffer);
if(div==0.00) TempBuffer=0;
else TempBuffer=100*(MathAbs(PlusDiBuffer-MinusDiBuffer)/div);
i--;
}
//---- ADX is exponential moving average on DX
for(i=0; iMinusDiBufferCurrent && PlusDiBufferPreviousMinusDiBufferPrevious)
{
Alert("AdxBearishX ",Symbol());
PlaySound("alert.wav");
return(0);
}
return(0);
}
//+------------------------------------------------------------------+
[ Last edited by 老正 on 2005-3-31 at 19:55 ]
9楼
if (PlusDiBufferCurrent>MinusDiBufferCurrent && PlusDiBufferPreviousMinusDiBufferPrevious)
{
Alert("AdxBearishX ",Symbol());
PlaySound("alert.wav");
return(0);
}
return(0);
[ Last edited by 老正 on 2005-3-31 at 19:55 ]
发表于:2005-04-06 03:37只看该作者
10楼
不需要指定“alert.wav”文件的绝对路径吗?比如“C:\MT\Sound\alert.wav”
当然如果没有这个声音文件的话,不可能响。
韬客外汇论坛TALKFOREX.COM