感謝大大的解析! ----				
			
		大家參考一下,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);
}				
			
		不會貼圖,有點懶的弄,看的懂的請自己看{:4_153:}				
			
		別人的程式,用盤整的區段來show圖
自己的程式,用趨勢的區段來show圖				
			
		回復 48# linchiyh 
真服了寫 MT4 的人搞工的要命				
			
		我會傳圖了 ^^不得不程認mt4這麼搞工
可是孕含了龐大的資源 {:4_161:}
 				
			
		如果一直變來變去時就一下買一下賣~
看來也不是很好的方法~				
			
		好棒的圖
不知道邏輯是什麼				
			
		謝謝分享,以後就不會上當了				
			
		前陣子看到廣告真的覺的很神,但仔細一想就覺的有問題,照這種積效來看,根本不用出
來賣軟體,但又看不出破碇,看到大大的解說才發現原來是障眼法,感謝大大破解,讓很
多人免花冤枉錢。				
			
		先收下了~ 謝謝分享				
			
		{:4_189:}~~感謝分享~~				
			
		單一指標似乎無法窺其全貌 最終脫離不了最基本的量價				
			
		盤整真是趨勢的最大敵人. 有沒有人可以解決呢?				
			
		不會啊, 那些搞套利的, 或是自營外資等法人的進出, 沒聽說他們在看K線的. 因為K線就是他們畫的.
似乎只有 ...
wldtw2008 發表於 10-7-20 10:00 AM http://coco-in.net/images/common/back.gif
    那我們這些靠k線的人, 有可能賺嗎? {:4_154:}