[¡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 276

 

Por cierto,- ¿alguien sabe cómo establecer el descriptor de nivel Fibo al crear un objeto gráfico con el programa?

Bueno, o al menos eliminar las correcciones de este gráfico:


 
int deinit()
  {
//----
   ObjectDelete("вершина");
  ObjectDelete("основание_первого_снижения  ");
   ObjectDelete("начало");
    ObjectDelete("точка4");
    ObjectDelete("пятая_точка!");
//----
   return(0);
Buenas tardes! ¿Cómo se escribe correctamente la limpieza de todos los objetos? Limpia de vez en cuando, y luego menos... Hasta ahora he estado limpiando así.
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,T,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,СинняячертаBuffer3);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
   
   
  ObjectDelete("вершина");
  ObjectDelete("основание_первого_снижения  ");
   ObjectDelete("начало");
    ObjectDelete("точка4");
    ObjectDelete("пятая_точка!");
//----
   return(0);
 
Dimka-novitsek:
Buenas tardes! ¿Cómo se escribe correctamente la limpieza de todos los objetos? Limpia de vez en cuando, y luego menos... Hasta ahora he estado limpiando así.
ObjectsDeleteAll
 

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

¡¡¡¡Funciona!!!!

 

¡Buenas tardes!

Por favor, aconséjenme una forma fiable de identificar un piso, si es que lo hay.

 
Espero que esta pregunta sea pertinente en este caso. ¿Cómo sería el programa más sencillo, en el que una orden (por ejemplo, de venta) se abrirá y después de un tiempo se modificará (cambiar el precio de apertura, SL, TP), y después de un tiempo se cerrará (independientemente del resultado)? No puedo entenderlo por mí mismo. Todo lo que vi fue un código de lavado de cerebro con búsqueda de órdenes y todo tipo de salida sin sentido...
 
evillive:

¡Buenas tardes!

Por favor, aconséjenme una forma fiable de identificar un piso, si es que lo hay.


La tendencia en un marco temporal puede convertirse fácilmente en un plano en otro. Por ejemplo, se puede coger una media móvil: si es lateral, la tendencia es lateral.
 
AlexLaptist:
Espero que esta pregunta sea pertinente en este caso. ¿Cómo sería el programa más sencillo, en el que una orden (por ejemplo, de venta) se abrirá y después de un tiempo se modificará (cambiar el precio de apertura, SL, TP), y después de un tiempo se cerrará (independientemente del resultado)? No puedo entenderlo por mí mismo. Todo lo que vi fue un código de lavado de cerebro con búsqueda de órdenes y todo tipo de salida sin sentido...


¿Has mirado esto? https://book.mql4.com/ru/samples/index

Generalmente, como cualquier otro programa, el suyo estará formado por bloques separados, cada uno de los cuales realiza una determinada tarea. Tomamos uno de esos bloques y escribimos nuestro propio código, lo depuramos y pasamos al siguiente bloque. Y así hasta el final del programa.
 
Buenas noches! Estimados usuarios del foro!
//+------------------------------------------------------------------+
//|                                            ИндюкДимонакомпил.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"
#import "user32.dll"
   int   PostMessageA(int  hWnd,int  Msg,int  wParam,string lParam);
#import
#define WM_COMMAND                     0x0111
int delimiter = 0;

#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;
 extern int T=4,K=200;
 int timeframe, start ;
 int бар_вершина ;
 int бар_основание_первого_снижения;
 int бар_начало;
int pereklutsatel;
double naklon,linija2; int P;extern int RO=-1;
//+------------------------------------------------------------------+
//| 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,T,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,СинняячертаBuffer3);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
   
   
  ObjectDelete("вершина");
  ObjectDelete("основание_первого_снижения  ");
   ObjectDelete("начало");
    ObjectDelete("точка4");
    ObjectDelete("пятая_точка!");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   ObjectDelete("вершина");
  ObjectDelete("основание_первого_снижения  ");
   ObjectDelete("начало");
    ObjectDelete("точка4");
    ObjectDelete("пятая_точка!");
   ObjectsDeleteAll(WindowOnDropped( ) , OBJ_TEXT);
//----
   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--) {
//----
 for ( int J=0;J<=RO;J++){
//----

  // for(int i=Bars; i>=0;i--)
   i=Bars;
      бар_вершина=iHighest( NULL,  timeframe, MODE_HIGH, K, start ) ;
       вершина =High[ бар_вершина ];
       бар_основание_первого_снижения=iLowest( NULL,  timeframe, MODE_LOW,NormalizeDouble ( бар_вершина/2,0), start ) ;
       основание_первого_снижения=Low[ бар_основание_первого_снижения ];
       бар_начало=iLowest( NULL,  timeframe, MODE_LOW,NormalizeDouble (бар_вершина*1.5,0), бар_вершина ) ;
       начало=Low[ бар_начало ];
       
   ObjectCreate( "вершина",  OBJ_TEXT , WindowOnDropped( ) , Time[бар_вершина],  вершина+(10*Point)) ; 
    ObjectSetText( "вершина", "вершина", 5, "вершина",Crimson ) ;// Alert("GetLastError()",GetLastError());
      // ObjectSet(  "вершина",  OBJPROP_COLOR, Crimson) ;
      
   ObjectCreate( "основание_первого_снижения",  OBJ_TEXT , WindowOnDropped( ) , Time[бар_основание_первого_снижения],  основание_первого_снижения-(10*Point)) ; 
    ObjectSetText( "основание_первого_снижения", "основание_первого_снижения", 5, "основание_первого_снижения",Crimson ) ;   
   
    ObjectCreate( "начало",  OBJ_TEXT , WindowOnDropped( ) , Time[бар_начало],  начало-(10*Point)) ; 
    ObjectSetText( "начало", "начало", 5, "начало",Crimson ) ;   
           
  if(начало>основание_первого_снижения){naklon=(начало-основание_первого_снижения)/(бар_начало-бар_основание_первого_снижения);
 // Alert("naklon  ", naklon);
    НижняячертаBuffer2[бар_начало]=начало;linija2=начало;for(i=бар_начало-1;i>=0;i--){linija2=linija2-naklon;
   
    НижняячертаBuffer2[i]=linija2;  // Alert ("linija2  " , linija2 );  Alert("НижняячертаBuffer2[i]  ", НижняячертаBuffer2[i] , "  i " , i);
     
   }
    НижняячертаBuffer2[бар_основание_первого_снижения]=основание_первого_снижения;}
    
    
         for (i=0;i<100;i++){  СинняячертаBuffer3[i]= Open[i];}
          for (i=330;i<500;i++){  СинняячертаBuffer3[i]= Open[i];}

     ВерхняячертаBuffer1[бар_начало]=начало;
     
 double точка4; int бар_точка4;   бар_точка4=iHighest( NULL,  timeframe, MODE_HIGH, бар_основание_первого_снижения, 3 ) ; 
  точка4 =High[ бар_точка4 ];  
   
   if(вершина>точка4){naklon=(начало-точка4)/(бар_начало-бар_точка4);
   ObjectCreate( "точка4",  OBJ_TEXT , WindowOnDropped( ) , Time[бар_точка4],  точка4+(10*Point)) ; 
    ObjectSetText( "точка4", "точка4", 5, "точка4",Crimson ) ;  
   double linija1=начало;for(i=бар_начало-1;i>=0;i--){linija1=linija1-naklon;ВерхняячертаBuffer1[i]=linija1; }}
   
double vulf=НижняячертаBuffer2[0];
  if ( vulf==Ask||vulf==Bid)vulf=1;
 if (vulf+(10*Point)>Ask&&vulf-(10*Point)<Bid)vulf=1 ; 
           
      Alert ("vulf  " , vulf );   Comment ("  vulf!!! "  , vulf);  
   if (vulf==1){Comment ("  Есть вульв!!! "  , "  timeframe " , timeframe);
   ObjectCreate( "пятая_точка!",  OBJ_TEXT , WindowOnDropped( ) , Time[0],  Bid-(10*Point)) ; 
    ObjectSetText( "пятая_точка!", "пятая_точка!", 5, "пятая_точка!",Crimson ) ;   return(0);  }
    if (vulf!=1) {    
   
     if(delimiter<3){delimiter++;Comment(delimiter);return(0);}
   delimiter=0;
    fChangePeriod();P++;
                                 
                   }  } }
//----
   return(0);
  }
//+------------------------------------------------------------------+

void fChangePeriod(){int ii,hwd = WindowHandle(Symbol(),Period());
   switch(Period()){
      case PERIOD_W1    : ii = 33134; break; //PERIOD_D1;
      case PERIOD_D1    : ii = 33136; break; //PERIOD_H4;
      case PERIOD_H4    : ii = 33135; break; //PERIOD_H1;
      case PERIOD_H1    : ii = 33140; break; //PERIOD_M30;
      case PERIOD_M30   : ii = 33139; break; //PERIOD_M15;
      case PERIOD_M15   : ii = 33138; break; //PERIOD_M5;
      case PERIOD_M5    : ii = 33137; break; //PERIOD_M1;
      case PERIOD_M1    : ii = 33141; break; //PERIOD_W1;
   }     
   PostMessageA(hwd, WM_COMMAND, ii, 0);
   return;
}
El indicador que estoy moldeando funciona de maravilla... Con un montón de defectos, cómo decirlo, incluso mucho peor... Entre otras cosas, dibuja de forma intermitente. Sí, a menudo no se dibuja en el gráfico, pero a veces sí... ¿Cuál podría ser la causa común?
 
drknn:


¿Has mirado aquí? https://book.mql4.com/ru/samples/index

Generalmente, como cualquier otro programa, el suyo estará formado por bloques separados, cada uno de los cuales realiza una tarea. Tomas uno de esos bloques y escribes tu propio código, lo depuras y pasas al siguiente bloque. Y así hasta el final del programa.

Gracias...
Razón de la queja: