[아카이브!] 어떤 전문가나 지표도 무료로 작성해 드립니다. - 페이지 89

 
Vinin :
쉽지 않다. 버퍼가 충분하지 않습니다.
글쎄, 충분하지 않습니다. 그러나 저자는 히스토그램만을 원했습니다 :))
"다른 값을 가진 3개의 히스토그램이 있다는 것을 의미합니다."
[삭제]  
granit77 :
글쎄, 충분하지 않습니다. 그러나 저자는 히스토그램만을 원했습니다 :))
"다른 값을 가진 3개의 히스토그램이 있다는 것을 의미합니다."

그렇다면 실제로 3개의 히스토그램을 만들지 않는다는 것은 무엇을 의미합니까? 나는 단지 헛되이 코드를 강간 당했다?
[삭제]  
여기에 이것의 기초가 있습니다. 그리고 세 번째 히스토그램을 추가하는 방법을 이해하지 못합니다. 그가 하지 않은 일. 그것이 머리에 없다면.
 
alkeon :
그렇다면 실제로 3개의 히스토그램을 만들지 않는다는 것은 무엇을 의미합니까? 내가 헛되이 코드를 강간 당했다?
헛되이 아무 일도 일어나지 않습니다. 결과보다 경험이 더 중요합니다.
이 특별한 경우에는 모두 필요한 MACD 복사본 수에 따라 다릅니다. 하나의 사본에는 2개의 버퍼(히스토그램 및 신호 라인 )가 필요하며 총 8개의 버퍼가 필요합니다. 즉, 3개의 복사본은 6개의 버퍼를 사용하고 여전히 남아 있습니다.
당신의 고통은 어떻습니까? 코드는 어디에 있습니까?

추신
나는 당신의 프로토타입이 마음에 들지 않습니다. MACD가 2개가 아니라 순차 평활화가 있습니다. 더 나은 간단한 고전 MACD와 트리플을 가져 가라.
파일:
macd.mq4  3 kb
[삭제]  
주요 괴롭힘은 직장에서 컴퓨터에 있습니다. 그러나 이것은 문제가되지 않습니다. 나는 이미 그를 너무 괴롭혀서 무엇을 반복해야하는지 마음으로 기억합니다.
[삭제]  
프로그래밍을 하지 않은 것처럼 (생각한 대로) 더 단순한 것에서 왔습니다. 표시기 주셔서 감사합니다. 이제 이것으로 프릴을 시작하겠습니다.
[삭제]  

여기에서 멈췄습니다. 공식과 완전히 혼동됩니다. 뭐가 문제 야?

이것은 버그가 없는 최신 버전입니다. 하지만 같은 쓰레기.

파일:
macd_3.mq4  5 kb
 
일반적으로 방향이 정확하고 오류를 수정하면 작동합니다. 편집하지 않고 말로 설명하겠습니다.

 //+------------------------------------------------------------------+
//|                                                  Custom MACD.mq4 |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2004, MetaQuotes Software Corp."
#property  link       "http://www.metaquotes.net/"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 6
#property  indicator_color1  Silver
#property  indicator_color2  Red
#property  indicator_color3  Silver
#property  indicator_color4  Red
#property  indicator_color5  Silver
#property  indicator_color6  Red
#property  indicator_width1   2
//---- indicator parameters
extern int FastEMA= 12 ;
extern int SlowEMA= 26 ;
extern int SignalSMA= 9 ;
extern int FastEMA1= 12 ;
extern int SlowEMA1= 26 ;
extern int SignalSMA1= 9 ;
extern int FastEMA2= 12 ;
extern int SlowEMA2= 26 ;
extern int SignalSMA2= 9 ;
//---- indicator buffers
double      MacdBuffer[]; //Проверить соответствие нумерации
double      SignalBuffer[];
double      MacdBuffer1[];
double      SignalBuffer2[];
double      MacdBuffer3[];
double      SignalBuffer4[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle ( 0 , DRAW_HISTOGRAM ); // нумерация буферов должна идти подряд от 0 до 6
   SetIndexStyle ( 1 , DRAW_LINE );
   SetIndexDrawBegin ( 1 ,SignalSMA);
   IndicatorDigits ( Digits + 1 );
     SetIndexStyle ( 0 , DRAW_HISTOGRAM );
   SetIndexStyle ( 1 , DRAW_LINE );
   SetIndexDrawBegin ( 1 ,SignalSMA);
   IndicatorDigits ( Digits + 1 );
     SetIndexStyle ( 0 , DRAW_HISTOGRAM );
   SetIndexStyle ( 1 , DRAW_LINE );
   SetIndexDrawBegin ( 1 ,SignalSMA);
   IndicatorDigits ( Digits + 1 );
//---- indicator buffers mapping
   SetIndexBuffer ( 0 ,MacdBuffer);
   SetIndexBuffer ( 1 ,SignalBuffer);
   SetIndexBuffer ( 0 ,MacdBuffer);
   SetIndexBuffer ( 1 ,SignalBuffer);
   SetIndexBuffer ( 0 ,MacdBuffer);
   SetIndexBuffer ( 1 ,SignalBuffer);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName ( "MACD(" +FastEMA+ "," +SlowEMA+ "," +SignalSMA+ "," +FastEMA1+ "," +SlowEMA1+ "," +SignalSMA1+ "," +FastEMA2+ "," +SlowEMA2+ "," +SignalSMA2+ ")" );
   SetIndexLabel ( 0 , "MACD" );
   SetIndexLabel ( 1 , "Signal" );
//---- initialization done
   return ( 0 );
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {
   // Эта часть пишется только 1 раз
   int limit;
   int counted_bars= IndicatorCounted ();
//---- last counted bar will be recounted
   if (counted_bars> 0 ) counted_bars--;
   limit= Bars -counted_bars;
   //-------------------------------  
//---- macd counted in the 1-st buffer
   for ( int i= 0 ; i<limit; i++)
      MacdBuffer[i]= iMA ( NULL , 0 ,FastEMA, 0 , MODE_EMA , PRICE_CLOSE ,i)- iMA ( NULL , 0 ,SlowEMA, 0 , MODE_EMA , PRICE_CLOSE ,i);
//---- signal line counted in the 2-nd buffer
   for (i= 0 ; i<limit; i++)
      SignalBuffer[i]= iMAOnArray (MacdBuffer, Bars ,SignalSMA, 0 , MODE_SMA ,i);
      
      
       int limit;
   int counted_bars= IndicatorCounted ();
//---- last counted bar will be recounted
   if (counted_bars> 0 ) counted_bars--;
   limit= Bars -counted_bars;
//---- macd counted in the 1-st buffer
   for ( int i= 0 ; i<limit; i++)
      MacdBuffer1[i]= iMA ( NULL , 0 ,FastEMA, 0 , MODE_EMA , PRICE_CLOSE ,i)- iMA ( NULL , 0 ,SlowEMA, 0 , MODE_EMA , PRICE_CLOSE ,i);
//---- signal line counted in the 2-nd buffer
   for (i= 0 ; i<limit; i++)
      SignalBuffer2[i]= iMAOnArray (MacdBuffer, Bars ,SignalSMA, 0 , MODE_SMA ,i);
      
      
       int limit;
   int counted_bars= IndicatorCounted ();
//---- last counted bar will be recounted
   if (counted_bars> 0 ) counted_bars--;
   limit= Bars -counted_bars;
//---- macd counted in the 1-st buffer
   for ( int i= 0 ; i<limit; i++)
      MacdBuffer3[i]= iMA ( NULL , 0 ,FastEMA, 0 , MODE_EMA , PRICE_CLOSE ,i)- iMA ( NULL , 0 ,SlowEMA, 0 , MODE_EMA , PRICE_CLOSE ,i);
//---- signal line counted in the 2-nd buffer
   for (i= 0 ; i<limit; i++)
      SignalBuffer4[i]= iMAOnArray (MacdBuffer, Bars ,SignalSMA, 0 , MODE_SMA ,i);
      
//---- done
   return ( 0 );
  }
//+------------------------------------------------------------------+
[Deleted]  

좋은 하루, 친애하는 kubodel, 각 시간대의 00분이 아닌 거래가 열리도록 고문을 수정하십시오.

그리고 타임프레임 캔들의 시작부터 30초 후

 
abolk :

첫 번째 근사치에서 버퍼 번호를 수정했습니다.

Andrei Nikolaevich, 어디 서두르세요! 그는 스스로 알아냈겠지만 더 잘 기억했을 것입니다.