Hatalar, hatalar, sorular - sayfa 2228

 
Konstantin :

tüm kodun çıktısını alın ve kodu elleriyle nasıl yapılandıracağını bilmeyenler için ME'de bir şekillendirici var:


Şekillendirici yardımcı olmadı, bak, belki kod doğru yazılmamış
[Silindi]  
Impreza :

Lütfen yardım edin sorunu anlamadım...

Tam bilgi vermediğiniz için telepatiyi açıyoruz.

Mouse_event işleviniz WinUser32.mqh dosyasında yanlış bildirildi .

Bunun için doğru:

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

#include <WinDef.mqh>

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

Dosyalar:
WinDef.mqh  2 kb
 
Koldun Zloy :

Tam bilgi vermediğiniz için telepatiyi açıyoruz.

Mouse_event işleviniz WinUser32.mqh dosyasında yanlış bildirildi .

Bunun için düzelt:


tam bilgi verebilirmisin
[Silindi]  
Impreza :
tam bilgi verebilirmisin

WinUser32.mqh dosyasını, terminalin bit derinliğini, hatanın yeniden üretildiği kodu, hatanın oluştuğu satırı kastettim.

Bu bir sır mı?

 
Impreza :
Şekillendirici yardımcı olmadı, bak, belki kod doğru yazılmamış

Eh, kodun doğru yazılmaması gerçeği, artık şüphem yok, oturarak değil, ayakta yazmayı deneyin, bazen bir tef ile dans etmek yardımcı olur))

hatayı yeniden oluşturmak için tam kodu sağlamanız istendi, görmezden geldiniz, hafta sonu sona eriyor, bu yüzden kendi başınıza devam edin))

 
Koldun Zloy :

WinUser32.mqh dosyasını, terminalin bit derinliğini, hatanın yeniden üretildiği kodu, hatanın oluştuğu satırı kastettim.

Bu bir sır mı?

yine çalışmıyor, daha fazla hata değiştiriyorum, belki kütüphanedendir, bunu nasıl etkiler, kim bilir? Diğer bilgisayarda her şey çalıştı, hiçbir şey değişmedi ...
[Silindi]  
Impreza :
yine çalışmıyor, daha fazla hata değiştiriyorum, belki kütüphanedendir, bunu nasıl etkiler, kim bilir? Diğer bilgisayarda her şey çalıştı, hiçbir şey değişmedi ...

Yani hala bir sır.

Aferin. Devam etmek! Pes etme!

 
Impreza :


Biçimlendirilmiş kodu yapıştırmak için Alt+S tuşlarını kullanın. https://www.mql5.com/en/articles/24#editor

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

Biçimlendirilmiş kodu yapıştırmak için Alt+S tuşlarını kullanın. 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 );

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