编码帮助 - 页 631

 
mladen:

这是一个重绘版的sidus指标。

非重绘版可以从这里下载:https://www.mql5.com/en/forum/180648/page293

谢谢
 

@mladen,

你能修复这个指标吗...

我必须每次都刷新图表...谢谢你

//+------------------------------------------------------------------+
//|                                                 pendingorder.mq4 |
//|                                                            Extra |
//|                                           pendingorder@gmail.com |
//+------------------------------------------------------------------+
#property copyright "pendingorder"
#property link      "pendingorder@gmail.com"

#property indicator_chart_window
#property indicator_buffers 5
#property  indicator_color1 DarkTurquoise
#property  indicator_color2 DarkTurquoise
#property  indicator_color3 Crimson
#property  indicator_color4 DarkTurquoise
#property  indicator_color5 Red
#include <WinUser32.mqh>

extern int  History     =     1000;
extern int  Previous    =        0;
extern int  Bwidth      =        1;
extern int  Delay       =        1;
extern int  Equal       =        1;
bool Opti        =     true;
extern int  Atr         =      1; 

//--- buffers
double Buffer3[],Buffer4[],Buffer2[],Buffer1[],Buffer5[];
double win,win1=0,ck=0,cel=0,stp=0,ol,ol1,ok,ok1,ok2;
int cc=0,oeq,eq1,drw=1;
string wc,wii,wii1,wii2;
color col;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  hWindow = WindowHandle( Symbol(), Period() );
  oldBars = iBars(NULL,RefreshPeriod);
//---- indicators
   SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,0);
   SetIndexArrow(0,234);
   SetIndexBuffer(0,Buffer1);
   
   SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,0);
   SetIndexArrow(1,233);
   SetIndexBuffer(1,Buffer2);
   
   
   SetIndexBuffer(2,Buffer3);
   SetIndexStyle(2,DRAW_NONE,STYLE_SOLID,0);
   SetIndexArrow(2,249);
   SetIndexBuffer(3,Buffer4);
   SetIndexStyle(3,DRAW_NONE,STYLE_SOLID,0);
   SetIndexArrow(3,249);
   SetIndexStyle(4,DRAW_NONE,STYLE_SOLID,2);
   SetIndexArrow(4,253);
   SetIndexBuffer(4,Buffer5);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
  ObjectsDeleteAll(0,OBJ_TEXT); 
  ObjectsDeleteAll(0,OBJ_ARROW);
  ObjectsDeleteAll(0,OBJ_LABEL);
    
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
 
  //logo();
  if(Opti==true){
  drw=0;
  eq1=1;
 while (eq1<=13)
 {
  opti();
  eq1++;}} 
  eq1=Equal;
  drw=1;
  opti();
  return(0);}
 
 int opti(){
 int Counted_bars=IndicatorCounted();
  int i,k,s=10;
  double x,x1,y,y1,z,z1,s1,s2,h1,h2,j1,j2,j3,j4,v,a,a1,b,b1,Now1;
  datetime tim1;
   i=Bars-Counted_bars-1;   
  if (i>History-1) 
  i=History-1;
 while(i>=0) 
 { 
   k=i+Previous;                                 
   x=Open[i];    
   
   x1=Open[i+1];   
   while(k>=0)
   {
   y=Open[k+1];   
   y1=Open[k];    
   if(x>=(y-Bwidth*Point) && x<y)z++;             
   if(x1<=y1+Bwidth*Point && x1>y1)z1++;
   k--;}//-----------------------------------------------------------------
   double atr=iATR(NULL,0,Atr,i);                
   if(z>eq1)s1=High[i]+atr;                   
   if(z1>eq1)s2=Low[i]-atr;                  
   if(s1==h1)j1++; else j1=0;                
   if(s2==h2)j2++; else j2=0;                  
   if(j1>Delay)Buffer3[i]=s1; else j3=0;       
   if(j2>Delay)Buffer4[i]=s2;else  j4=0;       
   //----------------------------------------------------------------------------------
   string text = DoubleToStr(s1,4), text1 = DoubleToStr(s2,4),TP,SL,TP1,SL1,Now;
   TP="TP "+DoubleToStr(b,3);
   TP1="TP "+DoubleToStr(a,3);
   SL=DoubleToStr(a1,3);
   SL1=DoubleToStr(a,3);
   //------------------------------------------------------------------------
   tim1 =iTime(NULL,0,i);
   Now= DoubleToStr(iMA(NULL,0,Bwidth,0,MODE_SMA,PRICE_MEDIAN,i),4);//
   //----------------------------------------------------------------------------------------------------------
   v=MathAbs(s1-s2);                                 
   a=Low[i]-v*Point;                       
   a1=Low[i]+v;                                      
   b=High[i]+v*Point;                     
   b1=High[i]-v;     
   
                                   
   //-------------------------------------------------------------
   if(Low[i+1]>s1 && Low[i+2]>s1 && j3==0 && s1 >Open[i+3]&&atr<Volume[i])
   //------------------------------------------------------------------------------------------------
   {Now1=(a+b)/2;win++;
   if(drw==1){
   Buffer1[i]=b;
   Buffer5[i]=b1;
   //ObjectCreate(Now,OBJ_ARROW,0,tim1,High[i] + 20 * Point,0,0);
   //ObjectSet(Now,OBJPROP_ARROWCODE,234);
   //ObjectSet(Now,OBJPROP_COLOR,White);
   ObjectCreate(text,OBJ_ARROW,0,tim1,High[i] + 50 * Point,0,0);
   ObjectSet(text,OBJPROP_ARROWCODE,5);
   ObjectSet(text,OBJPROP_COLOR,Crimson);
   ObjectCreate(SL1,OBJ_ARROW,0,tim1,High[i] + 50 * Point,0,0,0,0);
   ObjectSet(SL1,OBJPROP_ARROWCODE,5);
   ObjectSet(SL1,OBJPROP_COLOR,DarkTurquoise);
   }
   j3=1;cel=b;cc=1;stp=b1;
   }
   
   
   //------------------------------------------------------------------------------
   if(j2>2){if(High[i+1]<s2 && High[i+2]<s2 && j4==0&& s2<Open[i+3]&&atr<Volume[i])
   //--------------------------------------------------------------------------------------------------------
   {j4=1;win++;Now1=(a+b)/2;
   if(drw==1){
   Buffer2[i]=a;Buffer5[i]=a1;
   //ObjectCreate(Now,OBJ_ARROW,0,tim1,Low[i] - 20 * Point,0,0);
   //ObjectSet(Now,OBJPROP_ARROWCODE,233);
   //ObjectSet(Now,OBJPROP_COLOR,White);
   ObjectCreate(text1,OBJ_ARROW,0,tim1,Low[i] - 50 * Point,0,0);
   ObjectSet(text1,OBJPROP_ARROWCODE,5);
   ObjectSet(text1,OBJPROP_COLOR,Crimson);
   ObjectCreate(SL,OBJ_ARROW,0,tim1,Low[i] - 50 * Point,0,0);
   ObjectSet(SL,OBJPROP_ARROWCODE,5);
   ObjectSet(SL,OBJPROP_COLOR,DarkTurquoise);
   }
   cel=a;cc=1;stp=a1;}}
   z=0;z1=0;h1=s1;h2=s2; 
   
   if(High[i]>cel&&Low[i]<cel&&cc==1){win1++;cc=0;ok1=ok1+(MathAbs(cel-Now1)/Point);}
   i--;}                            
   return(0);}
   

return(0);}    
 
mladen:

更多

这个指标我们可以照常使用

不需要做任何代码修改

你好,Mladen。您可以在这个指标中加入抛物线_Ziggy 的三次回归,以及以下程度的回归,例如,指标I-regr的做法?
你也可以在这个指标中加入同样程度的回归?
附加的文件:
 
Garry119:
你好,Mladen。你可以在这个指标中添加抛物线_Ziggy三次回归,并在下面的度数中进行回归,就像所做的那样,例如,指标I-regr?
你也可以在这个指标中加入同样程度的回归?

Garry


你是否尝试使用_RegressionDegree 参数

 

亲爱的mladen。

我想知道是否有可能在你的Averages_ribbon 2_3指标中的任何一条平均线上增加移位。如果能在平均线之间画上 "云",也会显得很疯狂。

也可以使用常规的箭头/警报代码,即使我觉得它不那么重要。

谢谢

[img]https://i.gyazo.com/2f6531b03b3780114167e08a23873961.png[/img]

 

你好 :)

我有一个小要求--谁能增加一个选项,设置多少个柱状图将被显示(100、500等)? 因为在RangeBar图表上,这个指标显示了 很多信号,它拖慢了我的平台...

非常感谢您 :)

附加的文件:
Patterns.mq4  17 kb
 
freakout:

你好 :)

我有一个小要求--谁能增加一个选项,设置多少个柱状图将被显示(100、500等)? 因为在RangeBar图表上,这个指标显示了很多信号,它拖慢了我的平台...

非常感谢您 :)

吓坏了

现在就去试试吧:

附加的文件:
 

嗨,Mladen,请帮助我处理下面图片的过滤问题。


 
kewu:

嗨,Mladen,请帮助我处理下面图片的过滤问题。


很抱歉,从那张图片来看,它可能是任何东西。没有办法知道它到底是什么,它在做什么。
 
NWFstudent:

亲爱的mladen。

我想知道是否有可能在你的Averages_ribbon 2_3指标中的任何一条平均线上增加移位。如果能在平均线之间画上 "云",也会显得很疯狂。

也可以使用常规的箭头/警报代码,即使我觉得它不那么重要。

谢谢

[img]https://i.gyazo.com/2f6531b03b3780114167e08a23873961.png[/img]

尊敬的NWF学生

问题是,在使用metatrader 4时,我们不能像metatrader 5那样使用填充区域。

明天将发布metatrader 5版本,你将看到metatrader 4中缺少什么。

原因: