点击了解:开户送美金 交易送红利

查看完整版本: 帮改一下指标,大师,有图,

901810 2010-8-10 18:34

帮改一下指标,大师,有图,

帮改一下指标,大师,有图,
在指标右边显示 M15 h1 h4周期图的值

#property indicator_separate_window
#property indicator_levelcolor DarkSlateGray
#property indicator_buffers 3
#property indicator_color1 DeepSkyBlue
#property indicator_color2 Red
#property indicator_color3 DeepSkyBlue
#property indicator_width1 2
#property indicator_level1 80.0
#property indicator_width2 2
#property indicator_level2 50.0
#property indicator_level3 20.0

extern int TimeFrame = 60;
extern int KPeriod = 8;
extern int DPeriod = 3;
extern int Slowing = 3;
extern int MAMethod = 0;
extern int PriceField = 1;
bool ShowDots = TRUE;
string PriceField_ = "0=Hi/Low   1=Close/Close";
string MA_Method_ = "SMA0 EMA1 SMMA2 LWMA3";
string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN;0-currentTF";
double g_ibuf_128[];
double g_ibuf_132[];
double g_ibuf_136[];

int init() {
   string ls_0;
   SetIndexBuffer(0, g_ibuf_128);
   SetIndexStyle(0, DRAW_SECTION);
   SetIndexBuffer(1, g_ibuf_132);
   SetIndexStyle(1, DRAW_LINE);
   if (ShowDots) {
      SetIndexBuffer(2, g_ibuf_136);
      SetIndexStyle(2, DRAW_ARROW);
      SetIndexArrow(2, 158);
      SetIndexShift(2, TimeFrame / Period() - 1);
      SetIndexEmptyValue(2, EMPTY_VALUE);
   }
   TimeFrame = MathMax(TimeFrame, Period());
   switch (TimeFrame) {
   case 1:
      ls_0 = "M1";
      break;
   case 5:
      ls_0 = "M5";
      break;
   case 15:
      ls_0 = "M15";
      break;
   case 30:
      ls_0 = "M30";
      break;
   case 60:
      ls_0 = "H1";
      break;
   case 240:
      ls_0 = "H4";
      break;
   case 1440:
      ls_0 = "D1";
      break;
   case 10080:
      ls_0 = "W1";
      break;
   case 43200:
      ls_0 = "MN";
      break;
   default:
      ls_0 = "TF0";
   }
   IndicatorShortName("GP_Stochastic");         
   return (0);
}

int start() {
   int lia_0[];
   int li_4 = IndicatorCounted();
   if (li_4 < 0) return (-1);
   if (li_4 > 0) li_4--;
   ArrayCopySeries(lia_0, 5, Symbol(), TimeFrame);
   int li_8 = Bars - li_4;
   li_8 = MathMax(li_8, TimeFrame / Period());
   int l_index_12 = 0;
   int l_shift_16 = 0;
   while (l_index_12 < li_8) {
      if (Time[l_index_12] < lia_0[l_shift_16]) l_shift_16++;
      g_ibuf_128[l_index_12] = iStochastic(NULL, TimeFrame, KPeriod, DPeriod, Slowing, MAMethod, PriceField, MODE_MAIN, l_shift_16);
      g_ibuf_132[l_index_12] = iStochastic(NULL, TimeFrame, KPeriod, DPeriod, Slowing, MAMethod, PriceField, MODE_SIGNAL, l_shift_16);
      if (ShowDots && Time[l_index_12] == lia_0[l_shift_16]) g_ibuf_136[l_index_12] = g_ibuf_128[l_index_12];
      l_index_12++;
   }
   
   return (0);
}

[[i] 本帖最后由 901810 于 2010-8-10 18:36 编辑 [/i]]

901810 2010-8-11 18:32

回复 1# 的帖子

pp012 大师呢,怎么还没现身?

丁不三 2010-8-11 20:57

哪里有大师。

901810 2010-8-12 07:09

回复 3# 的帖子

这里有大师的,只是没现身呢pp014

901810 2010-8-14 07:10

已解决,关闭

丁不三 2010-8-14 19:50

大师没出现就解决啦。
页: [1]
查看完整版本: 帮改一下指标,大师,有图,
QQ: 80039966 75263558 ; MSN: www.1fx.cn@hotmail.com ; Email: www.1fx.cn@gmail.com *杠杆交易像一把双刃剑,运用杠杆效应需要配合适当的风险管理,此种高度的杠杆效应可能导致损失或获得利润。