[¡Archivo!] Escribiré cualquier experto o indicador gratis. - página 89

 
Vinin:
No es más fácil. No hay suficientes topes.
No habría suficientes topes. Pero el autor sólo quería histogramas :))
"Me refiero a 3 histogramas con diferentes valores"
 
granit77:
No es suficiente. Pero el autor sólo quería histogramas :))
"Me refiero a 3 histogramas con diferentes valores"

¿Entonces no es realista hacer 3 histogramas? ¿Estoy perdiendo el tiempo con el código?
 
He utilizado este como base. No sé cómo añadir un tercer histograma. No sé qué hacer. Excepto estar de pie sobre mi cabeza.
 
alkeon:
¿Entonces no es realista hacer 3 histogramas? ¿Me he tomado tantas molestias para descifrar el código para nada?
Nada es para nada. La experiencia es más valiosa que el resultado.
En este caso concreto, depende del número de copias del MACD que necesite. Una copia requiere dos buffers (histograma y línea de señal), se necesitan ocho buffers en total. Es decir, tres copias ocuparán seis buffers y aún les sobrará algo.
¿Cómo está tu agonía? ¿Dónde está el código?

P.D.
No me gusta su prototipo. No son dos MACDs, es un suavizado secuencial. Mejor tomar un simple MACD clásico y triplicarlo.
Archivos adjuntos:
macd.mq4  3 kb
 
El principal acoso se produce en el trabajo con el ordenador. Pero eso no es problema, ya lo he atormentado tanto que puedo recordar de memoria lo que hay que repetir.
 
Es que es más fácil (como pensaba). Gracias por el indicador, ahora empezaré a cogerle el truco.
 

Aquí es donde lo dejé. Totalmente confundido con las fórmulas. ¿Qué pasa?

Esta es la última versión sin errores. Pero también es un desastre.

Archivos adjuntos:
macd_3.mq4  5 kb
 
En general, la dirección es correcta, arregla los errores y funcionará. No lo corregiré, lo explicaré con palabras.

//+------------------------------------------------------------------+
//|                                                  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);
  }
//+------------------------------------------------------------------+
 

Buen día estimado kubodel, por favor corrija el asesor para abrir un trato no a los 00 minutos de cada horario

y después de 30 segundos desde el inicio del marco temporal de la vela

 
abolk:

ajustado los números del buffer a una primera aproximación - luego depende de ti:

Andrey Nikolaevich, ¡qué prisa tienes! Se habría dado cuenta él mismo, pero lo habría recordado mejor.