50评论

0收藏

Stohastic With Flat

avatar 梦丫头 | 3763 人阅读 | 50 人评论 | 2020-11-17

USDJPYM30.png

[pre]//+------------------------------------------------------------------+
//|                                          Stohastic With Flat.mq4 |
//|                                                   Powered byStep |
//|                                                         04/03/14 |
//+------------------------------------------------------------------+
#property indicator_separate_window   
#property indicator_buffers 2      
#property indicator_color1 Green   
#property indicator_color2 Red      

extern string Stohastic = "Stohastic With Flat";
extern int K = 5;
extern int D = 3;
extern int slow = 3;
extern int avg_meth = 0;
extern int price = 1;
extern int BB = 20;
extern double flat =0.0009;

double Buf_0[],Buf_1[];         

int init()                        
  {
   SetIndexBuffer(0,Buf_0);         
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(1,Buf_1);      
   SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,1);
   return(0);                          
  }
//--------------------------------------------------------------------
int start()                        
  {
   int i,                          
       Counted_bars;               
//--------------------------------------------------------------------
   Counted_bars=IndicatorCounted();
   i=Bars-Counted_bars-1;           
   while(i>=0)                     
     {

    if ((iBands(NULL,0,BB,2,0,PRICE_MEDIAN,MODE_UPPER,i)-
          iBands(NULL,0,BB,2,0,PRICE_MEDIAN,MODE_MAIN,i)) < flat)
                 
      { if (iStochastic(NULL,0,K,D,slow,avg_meth,price,MODE_MAIN,i) >
            iStochastic(NULL,0,K,D,slow,avg_meth,price,MODE_SIGNAL,i))
            {Buf_0 = 55;Buf_1 = 45;}
       if (iStochastic(NULL,0,K,D,slow,avg_meth,price,MODE_MAIN,i) <
            iStochastic(NULL,0,K,D,slow,avg_meth,price,MODE_SIGNAL,i))
            {Buf_0 = 45;Buf_1 = 55;}
      }
    else
      {

      Buf_0=iStochastic(NULL,0,K,D,slow,avg_meth,price,MODE_MAIN,i);
      Buf_1=iStochastic(NULL,0,K,D,slow,avg_meth,price,MODE_SIGNAL,i);
      }
      i--;                        
     }
//--------------------------------------------------------------------
   return(0);                        
  }
[/pre]

""
还没有人打赏,支持一下

评论|共 50 个

付冒砍

发表于 2020-11-24 19:20:24 | 显示全部楼层

支持下

罗立芳

发表于 2020-12-3 20:59:11 | 显示全部楼层

顶下

初级阶段

发表于 2020-12-5 16:10:17 | 显示全部楼层

东门老三

发表于 2020-12-13 11:07:34 | 显示全部楼层

老好人

发表于 2020-12-17 10:36:47 | 显示全部楼层

支持下

dmpdc

发表于 2020-12-24 16:20:12 | 显示全部楼层

顶下

diamonddust77

发表于 2020-12-27 17:21:48 | 显示全部楼层

支持下

chenqikj

发表于 2020-12-31 20:36:15 | 显示全部楼层

christina-verso

发表于 2021-1-2 11:12:45 | 显示全部楼层

您需要登录后才可以回帖 登录 | 注册 微信登录

EA之家评论守则