客服热线:18391752892

SGMAR

   日期:2019-01-12     浏览:453    

//+------------------------------------------------------------------+
//|                                             |
//|           Copyright ?1999-2008, metaQuotes Software Corp. |
//|                           http://www.metaquotes.ru |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_buffers 5
//----
#property indicator_color1 Lime
#property indicator_color2 Aqua
#property indicator_color3 Red
#property indicator_color4 DarkTurquoise
#property indicator_color5 Red
//----
#property indicator_level1 70
#property indicator_level2 50
#property indicator_level3 30
#property indicator_levelcolor Gray
#property indicator_levelwidth 1
#property indicator_levelstyle STYLE_DASH
//----
extern int    Rsi =14;
extern int    Ma =8;
extern int    cbars =0;
//----
double RsiBuf[];
double MaP[];
double MaF[];
double Up[];
double Dn[];
//+------------------------------------------------------------------+
//|                                             |
//+------------------------------------------------------------------+
 void init()
 {
   SetIndexStyle (0, DRAW_LINE,0, 2);
   SetIndexStyle (1, DRAW_LINE,0,2);
   SetIndexStyle (2, DRAW_LINE,0,2);
   SetIndexStyle (3, DRAW_ARROW);
   SetIndexStyle (4, DRAW_ARROW);
   SetIndexBuffer(0, RsiBuf);
   SetIndexBuffer(1, MaP);
   SetIndexBuffer(2, MaF);
   SetIndexBuffer(3, Up);
   SetIndexBuffer(4, Dn);
   SetIndexEmptyValue(3,0);
   SetIndexEmptyValue(4,0);
   SetIndexArrow(3,108);
   SetIndexArrow(4,108);
 }
//+------------------------------------------------------------------+
//|                                             |
//+------------------------------------------------------------------+
 void deinit()
 {}
//+------------------------------------------------------------------+
//|                                             |
//+------------------------------------------------------------------+
 int start()
 {
   int shift,limit=cbars;
   if(limit==0) limit=Bars;
   for(shift=limit-1; shift shift--)
   {
     RsiBuf[shift]=iRSI(NULL,0,Rsi,PRICE_CLOSE,shift);
   }
   for(shift=limit-1; shift shift--)
   {
     // First Indicator Data
     MaF[shift]=iMAonArray(RsiBuf,0,Ma,0,MODE_SMA,shift);
     // Previous Indicator Data
     MaP[shift]=iMAonArray(RsiBuf,0,Ma,0,MODE_EMA,shift);
     if((MaF[shift]-MaP[shift])*(MaF[shift+1]-MaP[shift+1]) 0)
     {
       if(MaF[shift]-MaP[shift] 0) Up[shift]=MaP[shift];
       else Dn[shift]=MaF[shift];
     }
   }
 }
//+------------------------------------------------------------------+复制代码

外汇交易有很大的风险性,本站所有资源均来自网络,请选择使用,如若出现亏损,本站不承担任何责任!

特别提示:本信息由相关企业自行提供,真实性未证实,仅供参考。请谨慎采用,风险自负。


0相关评论
相关行情
推荐行情
点击排行