หน้าแรก ตัวชี้วัดทางเทคนิค โพสต์

EURX - คำนวณดัชนีเงินยูโรได้แล้ว! เครื่องมือใหม่สำหรับ MetaTrader 4

ไฟล์แนบ
13862.zip (212.86 KB, ดาวน์โหลด 0 ครั้ง)

ผู้เขียน: Andy Thompson

คำอธิบาย:

ในปี 2009 ผมได้เผยแพร่เครื่องมือสำหรับ DXY - ดัชนีเงินดอลลาร์ - ซึ่งได้รับการตอบรับเป็นอย่างดีและมีการดาวน์โหลดอย่างมากในภาษาอังกฤษและรัสเซีย ตอนนี้ผมได้ค้นพบการคำนวณสำหรับดัชนีเงินยูโร จึงขอนำเสนอเพื่อให้ชุมชนได้ใช้และแสดงความคิดเห็นกันครับ

คุณสามารถดูรายละเอียดเพิ่มเติมได้ที่ Forex Ltd


EURX


//+------------------------------------------------------------------+
//|                                                   Euro Index.mq4 |
//|                                  Copyright © 2015, Andy Thompson |
//|                                   mailto:andydoc1@googlemail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2015, Andy Thompson"
#property link      "mailto:andydoc1@googlemail.com"
#property strict
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_width1 2
#property indicator_color2 Yellow
#property indicator_width2 1
#property indicator_style2 1
#property indicator_color3 Lime
#property indicator_width3 1
#property indicator_style3 2
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
int i;
extern int short_term_SMA_period=20;
extern int long_term_SMA_period =40;
//int winind;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                     |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexLabel(0,"DXY");
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexLabel(1,short_term_SMA_period+"SMA");
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexLabel(2,long_term_SMA_period+"SMA");
   IndicatorShortName("Euro Index: EURX / "+short_term_SMA_period+"SMA / "+long_term_SMA_period+"SMA");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int counted_bars=IndicatorCounted();
   if(counted_bars < 0)  return(-1);
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
   if(counted_bars==0) limit-=1+long_term_SMA_period;
//---- main loop
   for(i=0; i<limit; i++)
     {
      ExtMapBuffer1[i]= 34.38805726*MathPow(iClose("EURUSD",0,i),0.3155)*MathPow(iClose("EURJPY",0,i),0.1891)*MathPow(iClose("EURGBP",0,i),0.3056)*MathPow(iClose("EURSEK",0,i),0.0785)*MathPow(iClose("EURCHF",0,i),0.1113);

     }
   for(i=0; i<limit; i++)
     {
      ExtMapBuffer2[i]=0;
      ExtMapBuffer3[i]=0;
      for(int z=0; z<long_term_SMA_period; z++)
        {
         if(z<short_term_SMA_period) ExtMapBuffer2[i]=ExtMapBuffer2[i]+ExtMapBuffer1[i+z];
         ExtMapBuffer3[i]=ExtMapBuffer3[i]+ExtMapBuffer1[i+z];
        }
      ExtMapBuffer2[i] = ExtMapBuffer2[i]/short_term_SMA_period;
      ExtMapBuffer3[i] = ExtMapBuffer3[i]/long_term_SMA_period;
     }
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

 

คำแนะนำ:

  • สามารถปรับเปลี่ยนระยะเวลาสำหรับค่าเฉลี่ยเคลื่อนที่ได้ - ค่าพื้นฐานคือ 20 และ 40
  • เครื่องมือนี้สามารถใช้ได้กับกราฟทุกประเภทและทุกช่วงเวลา

โพสต์ที่เกี่ยวข้อง

ความคิดเห็น (0)