求助!!!~在线等!!!~ 新评论 howii111 2015.08.04 06:43 我利用分形函数在每个上分形上 画了一条水平线,接下来想删除点差在50点范围内的两根水平线的一根我编的程序是这样的: #property indicator_chart_window#property indicator_buffers 2#property indicator_color1 Red#property indicator_color2 Yellowdouble UpperBuffer[]; //LowerBoffer[];//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+int OnInit() { // ---- indicator buffers mapping IndicatorBuffers(2); SetIndexBuffer(0,UpperBuffer); //SetIndexBuffer(1,LowerBuffer);//---- drawing settings SetIndexStyle(0,DRAW_ARROW); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(0,SYMBOL_ARROWUP); SetIndexArrow(1,SYMBOL_ARROWDOWN);//----//---- name for DataWindow//---- initialization done return 0; }//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+int start() { int i,j,limit; int couted_bars=IndicatorCounted(); if(couted_bars>0) couted_bars--; limit=Bars-couted_bars; for(i=0;i<limit;i++) UpperBuffer[i]=iFractals("EURUSD",0,MODE_UPPER,i); for(i=120;i>0;i--) { ObjectCreate("EX_Value_High"+DoubleToStr(i,0),OBJ_HLINE,0,Time[i],UpperBuffer[i]); ObjectSet("EX_Value_High"+DoubleToStr(i,0), OBJPROP_STYLE, 0); ObjectSet("EX_Value_High"+DoubleToStr(i,0), OBJPROP_WIDTH, 1); ObjectSet("EX_Value_High"+DoubleToStr(i,0), OBJPROP_COLOR, clrRed); } for(i=120;i>0;i--) { if(Upper_Buffer[i]-UpperBuffer[i-1]<=500*Point) ObjectDelete("EX_Value_High"+DoubleToStr(i,0)); } return 0; }但是这样不起作用,问题出在删除求各位大神告诉我正确的编程方法!~最后我想能够将所删选的价位作为返回值,谢谢大神了!!~ 编码帮助 我想写一个通道指标,但是不显示,求解 indicator not show ,help ~! Ojala EA 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
我利用分形函数在每个上分形上 画了一条水平线,接下来想删除点差在50点范围内的两根水平线的一根
我编的程序是这样的:
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Yellow
double UpperBuffer[]; //LowerBoffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
// ---- indicator buffers mapping
IndicatorBuffers(2);
SetIndexBuffer(0,UpperBuffer);
//SetIndexBuffer(1,LowerBuffer);
//---- drawing settings
SetIndexStyle(0,DRAW_ARROW);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(0,SYMBOL_ARROWUP);
SetIndexArrow(1,SYMBOL_ARROWDOWN);
//----
//---- name for DataWindow
//---- initialization done
return 0;
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,j,limit;
int couted_bars=IndicatorCounted();
if(couted_bars>0)
couted_bars--;
limit=Bars-couted_bars;
for(i=0;i<limit;i++)
UpperBuffer[i]=iFractals("EURUSD",0,MODE_UPPER,i);
for(i=120;i>0;i--)
{
ObjectCreate("EX_Value_High"+DoubleToStr(i,0),OBJ_HLINE,0,Time[i],UpperBuffer[i]);
ObjectSet("EX_Value_High"+DoubleToStr(i,0), OBJPROP_STYLE, 0);
ObjectSet("EX_Value_High"+DoubleToStr(i,0), OBJPROP_WIDTH, 1);
ObjectSet("EX_Value_High"+DoubleToStr(i,0), OBJPROP_COLOR, clrRed);
}
for(i=120;i>0;i--)
{
if(Upper_Buffer[i]-UpperBuffer[i-1]<=500*Point)
ObjectDelete("EX_Value_High"+DoubleToStr(i,0));
}
return 0;
}
但是这样不起作用,问题出在删除求各位大神告诉我正确的编程方法!~最后我想能够将所删选的价位作为返回值,谢谢大神了!!~