老王吧 发表于 2017-12-27 12:32:59

i-GentorLSMA&amp EMA v.0.2



#property copyright "下载更多外汇EA,外汇指标,交易系统,就到【外汇EA之家】"
#property link      "http://www.eazhijia.com"
//----
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Yellow
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Lime
//---- 马屮龛?镟疣戾蝠?---------------------------------------------
extern int EMAPeriod =34;// 襄痂钿 盘?
extern int LSMAPeriod=25;// 襄痂钿 LSMA
//---- 馏翦瘥 桧滂赅蝾疣 ---------------------------------------------
double LineHighEMA[];
double LineLowEMA[];
double LSMABuffer1[];
double LSMABuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init()
{
   IndicatorDigits(2);
   SetIndexStyle (0, DRAW_LINE, STYLE_SOLID, 3);
   SetIndexBuffer(0, LineHighEMA);
   SetIndexStyle (1, DRAW_LINE, STYLE_SOLID, 3);
   SetIndexBuffer(1, LineLowEMA);
   SetIndexBuffer(2, LSMABuffer1);
   SetIndexStyle (2, DRAW_LINE, STYLE_SOLID, 3);
   SetIndexBuffer(3, LSMABuffer2);
   SetIndexStyle (3, DRAW_LINE, STYLE_SOLID, 3);
   Comment("");
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                     |
//+------------------------------------------------------------------+
void deinit()
{
   Comment("");
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int i, shift, counted_bars=IndicatorCounted();
   int Draw4HowLong, loopbegin;
   double sum, lengthvar, tmp, wt;
//----
   if (counted_bars<0) return;
   if (counted_bars>0) counted_bars--;
   counted_bars=Bars - counted_bars;
   for(shift=0; shift<counted_bars; shift++)
   {
      LineLowEMA=-1;
      LineHighEMA=-1;
//----
      double EmaValue=iMA(NULL, 0, EMAPeriod, 0, MODE_EMA, PRICE_TYPICAL, shift);
      if (Close > EmaValue) LineHighEMA=EMPTY_VALUE;
      else
         if (Close < EmaValue) LineLowEMA=EMPTY_VALUE;
   }
   Draw4HowLong=Bars-LSMAPeriod - 5;
   loopbegin=Draw4HowLong - LSMAPeriod - 1;
//----
   for(shift=loopbegin; shift>=0; shift--)
   {
      sum=0;
      for(i=LSMAPeriod; i>=1; i--)
      {
         lengthvar=LSMAPeriod + 1;
         lengthvar/=3;
         tmp=0;
         tmp=(i - lengthvar)*Close;
         sum+=tmp;
      }
      wt=sum*6/(LSMAPeriod*(LSMAPeriod+1));
//----
      LSMABuffer1=1;
      LSMABuffer2=1;
//----
      if (wt > Close) LSMABuffer2=EMPTY_VALUE;
      else
         if (wt < Close) LSMABuffer1=EMPTY_VALUE;
   }
}
//+------------------------------------------------------------------+



3568 发表于 2019-2-22 01:09:39

感謝您的分享!!

ztruccos122 发表于 2020-1-5 17:21:54

沙发!沙发!

uoykp 发表于 2020-1-16 18:27:31

前排支持下

唯儿 发表于 2020-8-5 22:32:45

帮你顶下哈!!

把握商机 发表于 2020-8-6 12:19:16

帮你顶下哈!!

ok按臣工 发表于 2020-8-25 11:07:23

帮你顶下哈!!

如果爱忘了 发表于 2020-11-7 15:22:54

{:1_186:}

钱奎通 发表于 2021-7-15 11:22:39

谢谢

EA狙击手 发表于 2021-7-22 21:41:15

顶下
页: [1] 2
查看完整版本: i-GentorLSMA&amp EMA v.0.2