Errores, fallos, preguntas - página 2228

 
Konstantin:

Toda la salida de código y para aquellos que no pueden estructurar el código a mano, ME tiene un estilizador:


El estilizador no ayudó, mira si el código no está escrito correctamente
 
Impreza:

Por favor, ayuda cuál es el problema que no puedo entender....

Ya que no has proporcionado información completa, vamos a activar la telepatía.

Has declarado incorrectamente la función mouse_event en tu archivo WinUser32.mqh.

Corríjalo a esto:

#define _WIN64  // Только для 64-разрядного терминала!

#include <WinDef.mqh>

#import "User32.dll"
  void mouse_event( DWORD dwFlags, DWORD dx, DWORD dy, DWORD dwData, ULONG_PTR dwExtraInfo );
#import

Archivos adjuntos:
WinDef.mqh  2 kb
 
Koldun Zloy:

Ya que no has proporcionado toda la información, vamos a encender la telepatía.

Su archivo WinUser32.mqh no declara correctamente la función mouse_event.

Corríjalo a esto:


¿se le permitiría proporcionar información completa?
 
Impreza:
¿sería posible proporcionarle información completa?

Me refería al archivoWinUser32.mqh, al tamaño del terminal, al código en el que se reproduce el error, a la línea en la que se produce el error.

¿Es un secreto?

 
Impreza:
El estilizador no ayudó, mira si el código no está escrito correctamente

Pues no me cabe duda de que el código no está escrito correctamente, prueba a escribirlo de pie en lugar de sentado, a veces bailar la pandereta ayuda ))

se te pidió el código completo para reproducir el error, lo has ignorado, el fin de semana ha terminado, así que sigue adelante ))

 
Koldun Zloy:

Me refería al archivoWinUser32.mqh, al tamaño del terminal, al código en el que se reproduce el error, a la línea en la que se produce el error.

¿Es un secreto?

Todavía no funciona, cambio más errores se convierten, tal vez es en la biblioteca, cómo afecta quién sabe? Todo funcionó en otro ordenador, no se cambió nada...
 
Impreza:
Sigue sin funcionar, cambio más errores, tal vez sea la biblioteca, ¿quién sabe cómo afecta esto? Todo funcionó en el otro ordenador, no se cambió nada...

Así que es un secreto después de todo.

Bien por ti. ¡Aguanta! No te rindas.

 
Impreza:


Utilice Alt+S para insertar el código con formato. https://www.mql5.com/ru/articles/24#editor

MQL5.community - Памятка пользователя
MQL5.community - Памятка пользователя
  • www.mql5.com
Теперь вы можете не только читать статьи и скачивать программы на языке MQL5, но и участвовать в обсуждении интересующих вас тем на Форуме, оставлять комментарии к статьям и опубликованным кодам. Кроме того, вы можете не только выкладывать собственные разработки в Code Base, но и публиковать Статьи, за которые мы предлагаем вознаграждение...
 
Sergey Savinkin:

Utilice Alt+S para insertar el código con formato. https://www.mql5.com/ru/articles/24#editor

//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                                   Copyright 2017 |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property version   "1.00"
#property strict
#property indicator_buffers 1
#property indicator_plots   0
//#property indicator_color1 Lime
datetime Tim=D'2018.10.10 23:00:00';
double y[];
datetime tine=0; string typ="";

input int   bye_x=1525; // Bye - x
input int   bye_y=432; // Bye - y
input int   sell_x=1525; // Sell - х
input int   sell_y=468; // Sell - у
input int   Stop_Limit=5; // Stop_Limit
input int   delta=2; // Spike

#include <WinUser32.mqh>
#import "user32.dll" 
bool  SetCursorPos(int PosX,int PosY);
#import 
input bool Allert=true; // Allert

const long allowed_accounts[]={ 8432237,240712,50188344,50186534,50187101,9675587,50224049,5000007084,50211205}; // 465438
int password_status=-1;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {

   EventSetMillisecondTimer(20);

   SetIndexBuffer(0,y,INDICATOR_DATA);

   long account=AccountInfoInteger(ACCOUNT_LOGIN);

   for(int i=0; i<ArraySize(allowed_accounts); i++)
      if(account==allowed_accounts[i])
        {
         password_status=1;
         break;
        }

   tine=TimeCurrent()+5;
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {

   return(rates_total);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTimer()
  {
   if(Tim>TimeCurrent())
     {

      double agr=(SymbolInfoDouble(Symbol(),SYMBOL_BID)+SymbolInfoDouble(Symbol(),SYMBOL_ASK))/2;
      y[0]=agr;

      for(int i=ArraySize(y)-1;i>=1;i--){y[i]=y[i-1];}

      if(y[1]+delta*Point()<y[0] || y[2]+delta*Point()<y[0] || 
         y[3]+delta*Point()<y[0] || y[4]+delta*Point()<y[0] || 
         y[5]+delta*Point()<y[0] || y[6]+delta*Point()<y[0] || 
         y[7]+delta*Point()<y[0] || y[8]+delta*Point()<y[0] || 
         y[9]+delta*Point()<y[0] || y[10]+delta*Point()<y[0] || 
         y[11]+delta*Point()<y[0] || y[12]+delta*Point()<y[0] || 
         y[13]+delta*Point()<y[0] || y[14]+delta*Point()<y[0] || 
         y[15]+delta*Point()<y[0] || y[16]+delta*Point()<y[0] || 
         y[17]+delta*Point()<y[0] || y[18]+delta*Point()<y[0] || 
         y[19]+delta*Point()<y[0] || y[20]+delta*Point()<y[0])

         if(password_status==1)
            Up_sig("Call_sig");

      if(y[1]-delta*Point()>y[0] || y[2]-delta*Point()>y[0] || 
         y[3]-delta*Point()>y[0] || y[4]-delta*Point()>y[0] || 
         y[5]-delta*Point()>y[0] || y[6]-delta*Point()>y[0] || 
         y[7]-delta*Point()>y[0] || y[8]-delta*Point()>y[0] || 
         y[9]-delta*Point()>y[0] || y[10]-delta*Point()>y[0] || 
         y[11]-delta*Point()>y[0] || y[12]-delta*Point()>y[0] || 
         y[13]-delta*Point()>y[0] || y[14]-delta*Point()>y[0] || 
         y[15]-delta*Point()>y[0] || y[16]-delta*Point()>y[0] || 
         y[17]-delta*Point()>y[0] || y[18]-delta*Point()>y[0] || 
         y[19]-delta*Point()>y[0] || y[20]-delta*Point()>y[0])

         if(password_status==1)
            Dn_sig("Sell_sig");

        }else {Alert("Демо-период завершён ",TimeToString(Tim));
     }

  }
//+------------------------------------------------------------------+

void Up_sig(string txt)
  {
   if(TimeCurrent()>(tine+Stop_Limit))
     {
      tine=TimeCurrent();

      if(Allert) Alert(txt);

      SetCursorPos(bye_x,bye_y);
      mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
      mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);

     }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void Dn_sig(string txt)
  {
   if(TimeCurrent()>(tine+Stop_Limit))
     {
      tine=TimeCurrent();

      if(Allert) Alert(txt);

      SetCursorPos(sell_x,sell_y);
      mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
      mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);

     }
  }
//+------------------------------------------------------------------+
 
Impreza:
#property indicator_chart_window

input int  bye_x = 1525;   // Bye - x
input int  bye_y = 432;    // Bye - y
input int  sell_x = 1525;  // Sell - х
input int  sell_y = 468;   // Sell - у
input int  Stop_Limit = 5; // Stop_Limit
input int  delta = 2;      // Spike
input bool Allert = true;  // Allert

#define  MOUSEEVENTF_LEFTDOWN    0x0002 // left button down
#define  MOUSEEVENTF_LEFTUP      0x0004 // left button up

#define _WIN64  // Только для 64-разрядного терминала!

#include <WinDef.mqh>

#import "user32.dll" 
   BOOL SetCursorPos( int PosX, int PosY );
   void mouse_event( DWORD dwFlags, DWORD dx, DWORD dy, DWORD dwData, ULONG_PTR dwExtraInfo );
#import 

const long allowed_accounts[] = {8432237, 240712, 50188344, 50186534, 50187101, 9675587, 50224049, 5000007084, 50211205}; // 465438
datetime Tim = D'2018.10.10 23:00:00';
double y[];
int password_status = -1;
datetime tine = 0;
string typ = "";

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
   EventSetMillisecondTimer( 20 );
   
   SetIndexBuffer( 0, y, INDICATOR_DATA );
   
   long account = AccountInfoInteger( ACCOUNT_LOGIN );
   
   for( int i = 0; i < ArraySize( allowed_accounts ); i++ ){
      if( account == allowed_accounts[i] )
      {
         password_status = 1;
         break;
      }
   }
   
   tine = TimeCurrent() + 5;
//---
   return INIT_SUCCEEDED;
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   return rates_total;
}
//+------------------------------------------------------------------+
void OnTimer()
{
   if( Tim > TimeCurrent() )
   {
      double agr = (SymbolInfoDouble( Symbol(), SYMBOL_BID ) + SymbolInfoDouble( Symbol(), SYMBOL_ASK )) / 2.0;
      y[0] = agr;

      for( int i = ArraySize(y)-1; i >= 1; i--)
      {
         y[i] = y[i-1];
      }
      
      double dp = delta * Point();

      if( y[1] + dp < y[0] || y[2] + dp < y[0] || 
         y[3] + dp < y[0] || y[4] + dp < y[0] || 
         y[5] + dp < y[0] || y[6] + dp < y[0] || 
         y[7] + dp < y[0] || y[8] + dp < y[0] || 
         y[9] + dp < y[0] || y[10] + dp < y[0] || 
         y[11] + dp < y[0] || y[12] + dp < y[0] || 
         y[13] + dp < y[0] || y[14] + dp < y[0] || 
         y[15] + dp < y[0] || y[16] + dp < y[0] || 
         y[17] + dp < y[0] || y[18] + dp < y[0] || 
         y[19] + dp < y[0] || y[20] + dp < y[0])
      {
         if( password_status == 1 ){
            Up_sig( "Call_sig" );
         }
      }

      if(y[1] - dp > y[0] || y[2] - dp > y[0] || 
         y[3] - dp > y[0] || y[4] - dp > y[0] || 
         y[5] - dp > y[0] || y[6] - dp > y[0] || 
         y[7] - dp > y[0] || y[8] - dp > y[0] || 
         y[9] - dp > y[0] || y[10] - dp > y[0] || 
         y[11] - dp > y[0] || y[12] - dp > y[0] || 
         y[13] - dp > y[0] || y[14] - dp > y[0] || 
         y[15] - dp > y[0] || y[16] - dp > y[0] || 
         y[17] - dp > y[0] || y[18] - dp > y[0] || 
         y[19] - dp > y[0] || y[20] - dp > y[0])
      {
         if( password_status == 1 ){
            Dn_sig( "Sell_sig" );
         }
      }
   }
   else {
      Alert( "Демо-период завершён ", TimeToString( Tim ) );
   }
}
//+------------------------------------------------------------------+
void Up_sig( string txt )
{
   if( TimeCurrent() > (tine + Stop_Limit) )
   {
      tine = TimeCurrent();
      
      if( Allert ) Alert( txt );
      
      SetCursorPos( bye_x, bye_y );
      mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
      mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
   }
}
//+------------------------------------------------------------------+
void Dn_sig( string txt )
{
   if( TimeCurrent() > (tine + Stop_Limit) )
   {
      tine=TimeCurrent();
      
      if( Allert ) Alert( txt );
      
      SetCursorPos( sell_x, sell_y );
      mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
      mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
   }
}
//+------------------------------------------------------------------+