sjy039 發表於 10-10-24 22:00

感謝大大的解析! ----

linchiyh 發表於 10-10-27 07:53

大家參考一下,ema並不是非常正確
MT4 code

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Blue

extern int Hours_START;
extern int Hours_FINISH;

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//----
int ExtCountedBars=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|
int init()
{
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, Red);
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, Blue);
   SetIndexBuffer(1, ExtMapBuffer2);
   SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Red);
   SetIndexBuffer(2, ExtMapBuffer3);
   SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, Blue);
   SetIndexBuffer(3, ExtMapBuffer4);
//----
   SetIndexDrawBegin(0,10);
   SetIndexDrawBegin(1,10);
   SetIndexDrawBegin(2,10);
   SetIndexDrawBegin(3,10);
//---- indicator buffers mapping
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexBuffer(3,ExtMapBuffer4);
//---- initialization done
   return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                     |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
   
//----
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+

bool withinPeriod()
{
         
         int h = TimeHour( CurTime() );
         
         return (h>=Hours_START && h<=Hours_FINISH );      
} //withiPERIOD


void setColors()
{
       if (withinPeriod())
       {
         SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, Red);
         SetIndexBuffer(0, ExtMapBuffer1);
         SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, Blue);
         SetIndexBuffer(1, ExtMapBuffer2);
         SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Red);
         SetIndexBuffer(2, ExtMapBuffer3);
         SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, Blue);
         SetIndexBuffer(3, ExtMapBuffer4);
       }
       else
       {
         SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, Lime);
         SetIndexBuffer(0, ExtMapBuffer1);
         SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, Lime);
         SetIndexBuffer(1, ExtMapBuffer2);
         SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, Lime);
         SetIndexBuffer(2, ExtMapBuffer3);
         SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, Lime);
         SetIndexBuffer(3, ExtMapBuffer4);
       }
} //setColors


// THIS IS LEFT UNTOUCHES AS IN THE ORIGINAL INDICATOR
int start()
{
   double haOpen, haHigh, haLow, haClose;
   if(Bars<=10) return(0);
   ExtCountedBars=IndicatorCounted();
//---- check for possible errors
   if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
   if (ExtCountedBars>0) ExtCountedBars--;
   int pos=Bars-ExtCountedBars-1;
   while(pos>=0)
   {
      haOpen=(ExtMapBuffer3+ExtMapBuffer4)/2;
      haClose=(Open+High+Low+Close)/4;
      haHigh=MathMax(High, MathMax(haOpen, haClose));
      haLow=MathMin(Low, MathMin(haOpen, haClose));
      if (haOpen<haClose)
      {
         ExtMapBuffer1=haLow;
         ExtMapBuffer2=haHigh;
      }
      else
      {
         ExtMapBuffer1=haHigh;
         ExtMapBuffer2=haLow;
      }

      ExtMapBuffer3=haOpen;
      ExtMapBuffer4=haClose;
           pos--;
   }
//----
   return(0);
}

linchiyh 發表於 10-10-27 08:07

不會貼圖,有點懶的弄,看的懂的請自己看{:4_153:}

一覽眾山小 發表於 10-10-27 12:27

別人的程式,用盤整的區段來show圖
自己的程式,用趨勢的區段來show圖

tpkpm 發表於 10-10-27 15:30

回復 48# linchiyh


真服了寫 MT4 的人搞工的要命

linchiyh 發表於 10-10-28 05:58

我會傳圖了 ^^不得不程認mt4這麼搞工
可是孕含了龐大的資源 {:4_161:}

usermail 發表於 10-11-3 19:06

如果一直變來變去時就一下買一下賣~
看來也不是很好的方法~

奇魔5代 發表於 10-11-14 04:20

好棒的圖
不知道邏輯是什麼

hchun 發表於 10-11-14 11:00

謝謝分享,以後就不會上當了

綠幽靈 發表於 10-11-17 11:34

前陣子看到廣告真的覺的很神,但仔細一想就覺的有問題,照這種積效來看,根本不用出
來賣軟體,但又看不出破碇,看到大大的解說才發現原來是障眼法,感謝大大破解,讓很
多人免花冤枉錢。

sukiy 發表於 10-11-22 14:06

先收下了~ 謝謝分享

alan_wang0208 發表於 10-11-28 23:10

{:4_189:}~~感謝分享~~

a7852002 發表於 10-11-29 07:33

單一指標似乎無法窺其全貌 最終脫離不了最基本的量價

tempchan 發表於 10-11-30 12:47

盤整真是趨勢的最大敵人. 有沒有人可以解決呢?

tempchan 發表於 10-11-30 12:50

不會啊, 那些搞套利的, 或是自營外資等法人的進出, 沒聽說他們在看K線的. 因為K線就是他們畫的.
似乎只有 ...
wldtw2008 發表於 10-7-20 10:00 AM http://coco-in.net/images/common/back.gif


    那我們這些靠k線的人, 有可能賺嗎? {:4_154:}
頁: 1 2 3 [4] 5
查看完整版本: 紅買綠賣騙術