06
2015
05

hans?????

???????????????????hans??? 

//+------------------------------------------------------------------+
//|                                                         hans.mq4 |
//|                                                                  |
//|                                           http://www.forexmt4.cn |
//+------------------------------------------------------------------+
#property copyright ""
#property link         "http://www.forexmt4.cn"
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 DarkTurquoise
#property indicator_color4 Magenta
#property indicator_width1 1
#property indicator_width2 1
extern int BeginSession=7;
extern int LengthSession=4;
extern int ????=60;
extern int pips       =5;
double buystop[];
double sellstop[];
double top[];
double lop[];
//+------------------------------------------------------------------+
int init()
     {
IndicatorBuffers(4);
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_LINE,1);
SetIndexStyle(3,DRAW_LINE,1);
SetIndexBuffer(0,buystop);
SetIndexBuffer(1,sellstop);
SetIndexBuffer(2,top);

SetIndexBuffer(3,lop);
      return(0);
     }
//+------------------------------------------------------------------+
int start()
     {
     int R;
     if(Period()==1) R=60;
     if(Period()==5) R=12;
     if(Period()==15) R=4;
     if(Period()==30) R=2;
     if(Period()==60) R=1;
     if(Period()>60) {Alert("??????????");return(0);}
      int       counted_bars=IndicatorCounted();
//----
      for(int i=counted_bars;i>=0;i--)
   
      {
       if (TimeHour(Time[i])==BeginSession+LengthSession && TimeMinute(Time[i])<=1) 
        {
        buystop[i]=0;
           for(int cnt=R*LengthSession;cnt>0;cnt--)
           {
           if(buystop[i]<High[i+cnt]+pips*Point) buystop[i]=High[i+cnt]+pips*Point;
           if(sellstop[i]>Low[i+cnt]-pips*Point) sellstop[i]=Low[i+cnt]-pips*Point;
           }
     lop[i]=sellstop[i]-????*Point;
     top[i]=buystop[i]+????*Point;
        }
     if ((TimeHour(Time[i])>BeginSession+LengthSession && TimeHour(Time[i])<18)||(TimeHour(Time[i])==BeginSession+LengthSession && TimeMinute(Time[i])>1))
      {
     sellstop[i]=sellstop[i+1];
     buystop[i]=buystop[i+1];
     lop[i]=sellstop[i]-????*Point;
     top[i]=buystop[i]+????*Point;
      }
   
      }
//----
      return(0);
     }

 

« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。