[¡Archivo!] Cualquier pregunta de novato, para no saturar el foro. Profesionales, no pasen de largo. No puedo ir a ningún sitio sin ti - 4. - página 238

 
Roman.:

¿Qué le impide cambiar MODE_ASK aquí a 1,1111 para una orden de compra, por ejemplo? La función está lista - edítala.


Gracias.
 
deyron:

Por encima de un puesto bajo corregido. No hay nada allí (vacío) criterios para pasar un MA a través de otro y viceversa.

El hecho mismo de que si un búfer - sin preguntas, pero el mismo a través de la segunda, tercera o cuarta, no se transmite, o más bien no funciona.



Si hay un buffer en el indicador, debe hacerlo en consecuencia
 
costy_:
los indicadores no funcionan con un deslizamiento, ¡para no detener el flujo comercial!

¡¡¡¡¡Esa es la cuestión, el indicador sólo funciona con el deslizamiento y el "contador vacío", no dibuja nada sin ellos!!!!! Es increíble, asombroso, incomprensible, al final no es normal, ¡pero tenía que escribir el código!
//+------------------------------------------------------------------+
//|                                                   Синяячерта.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 DarkBlue

double ВерхняячертаBuffer1[];
double НижняячертаBuffer2[];
double СинняячертаBuffer3[];
 double вершина; 
 double основание_первого_снижения;
 double начало;
 double вершина_волны_3;
 
 int timeframe, start ;
 int бар_вершина ;
 int бар_основание_первого_снижения;
 int бар_начало;
 
 double Pustostsetscyk;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(0,ВерхняячертаBuffer1);//Alert ("SetIndexBuffer ",GetLastError( ) );
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(1,НижняячертаBuffer2);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,СинняячертаBuffer3);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   for (int i=0;i<100;i++){  СинняячертаBuffer3[i]= Open[i];}
          for (i=330;i<500;i++){  СинняячертаBuffer3[i]= Open[i];}
         for (i=0;i<500;i++){ Pustostsetscyk++;} Pustostsetscyk=0;
         Sleep(4000);
     i=Bars;
       бар_вершина=iHighest( NULL,  timeframe, MODE_HIGH, i, start ) ;
       вершина =High[ бар_вершина ];
       бар_основание_первого_снижения=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина, start ) ;
       основание_первого_снижения=Low[ бар_основание_первого_снижения ];
       бар_начало=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина*2, бар_вершина ) ;
       начало=Low[ бар_начало ];
       Sleep(4000);
      //   Alert ( " бар_вершина   ",бар_вершина  , " вершина  " , вершина ,
      //    " бар_основание_первого_снижения  " ,бар_основание_первого_снижения  , " основание_первого_снижения  " , основание_первого_снижения , 
      //    " бар_начало  " , бар_начало   , " начало  " , начало    );
  
    НижняячертаBuffer2[бар_начало]=начало;
    НижняячертаBuffer2[бар_основание_первого_снижения]=основание_первого_снижения;
    for ( i=0;i<10;i++){  НижняячертаBuffer2[i]= Open[i];}
     Sleep(4000);     
    for (i=0;i<500;i++){ Pustostsetscyk++;}   Pustostsetscyk=0;   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

Y el marco temporal no se puede cambiar, todo desaparece para siempre.

He tenido que añadir una línea for (i=0;i<300;i++){ Alert ( Bottom lineBuffer2[i]); }, ¡no dibuja sin ella!

Y de vez en cuando, ¡realmente se dibuja! Así que puse el grosor de la línea a 4, lo compilé y ¡¡¡no!!!

Acabo de poner el indicador en el gráfico, no está ahí. Espero dos minutos y ya no está. Sin quitarlo del gráfico, vuelvo a compilar el mismo código en el editor de Metatrader.

 
Dimka-novitsek:

¡¡¡¡¡Esa es la cuestión, el indicador sólo funciona con deslizamiento y "contador vacío", no dibuja nada sin ellos!!!!! Es sorprendente, asombroso, incomprensible, al final no es normal, ¡pero tenía que escribir el código!


Empieza con esto.

//+------------------------------------------------------------------+
//|                                                   Синяячерта.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 DarkBlue

double BufferUP[];
double BufferDN[];
double BufferBlue[];

 
 double Pustostsetscyk;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(0,BufferUP);//Alert ("SetIndexBuffer ",GetLastError( ) );
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(1,BufferDN);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,BufferBlue);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   int limit=Bars-counted_bars-1;

   for (int i=limit;i>=0;i--) {
      BufferBlue[i]  = Open[i];
      BufferUP[i]    = High[i];
      BufferDN[i]    = Low[i];
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

¡¡¡¡¡¡Gracias!!!!!!

¡¡¡Grandioso!!!

 
Dimka-novitsek:
¡¡¡¡¡¡Gracias!!!!!!

Se ha corregido ligeramente el post anterior
 
Ya sabes, cuando cambias de marco temporal también desaparece, y de forma permanente, ya no se muestra en ningún marco temporal. Bueno, para empezar intentaré hacer algo útil. Supongo que mi ordenador se está borrando o algo así.
 
Dimka-novitsek:
Ya sabes, cuando cambias de marco temporal también desaparece, y de forma permanente, ya no se muestra en ningún marco temporal. Bueno, para empezar intentaré hacer algo útil. Supongo que mi ordenador se está borrando o algo así.

He arreglado un poco el código, ya he escrito
 
Ahora. ¡Oh, vaya! ¡Sí! ¡Genial!