帖子
作者
回复/查看
最后发表
2006-10-27 10:38
我能用的啊,原来地帖子我找了几个小时都没有找到,不过找到两个帖子可能能满足你的要求;
http://www.talkfx.com/viewthread.php?tid=92525&extra=page%3D4
http://www.talkfx.com/viewthread.php?tid=85168&extra=page%3D1&page=2
2006-10-27 10:38
以前这里有编过这个指标,我找不到原来的地址了,下面这个就是当时我保存的,请慢用,感谢原作者。
写成这样就不会说了
//+------------------------------------------------------------------+
//| Copyright ?2005, [email protected]
//| http://man2078.home4u.china.com/|
//+------------------------------------------------------------------+
#property copyright "[email protected]"
#property link "http://man2078.home4u.china.com"
#property indicator_chart_window
#property indicator_buffers 10
#property indicator_color1 Blue
#property indicator_color2 Red
//---- buffers
double buy,sell;
extern int fast=8;
extern int slow=50;
double LastAlertTime=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexBuffer(0,buy);
SetIndexEmptyValue(0,0.0);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,234);
SetIndexBuffer(1,sell);
SetIndexEmptyValue(1,0.0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
for (int i=Bars-1;i>=0;i--)
{
if
(
(
iMA(NULL,0,fast,0,MODE_EMA,PRICE_CLOSE,i)iMA(NULL,0,slow,0,MODE_EMA,PRICE_CLOSE,i+1)
)
)
{
sell=High+2*Point;
if (i==1 && LastAlertTime!=Time[0])
{
Alert("Negative Cross");
LastAlertTime=Time[0];
}
}
if
(
(
iMA(NULL,0,fast,0,MODE_EMA,PRICE_CLOSE,i)>iMA(NULL,0,slow,0,MODE_EMA,PRICE_CLOSE,i)
&& iMA(NULL,0,fast,0,MODE_EMA,PRICE_CLOSE,i+1)
2006-10-26 13:38
2006-10-05 12:24