Pouvez-vous me dire ce que signifie cette erreur de l'Expert Advisor ? "2014.02.13 05:29:06.885 stop_gambling EURUSD,H1 : Erreur dans la mise en place du Sell trailing stop : 130" ? ?
Le code (expert) est en train de bousiller le terminal 64... Développeurs, à l'aide ! #956630
#import "msvcrt.dll"int memcpy(int &dst[], double &src[], int cnt);
#import "ntdll.dll"int RtlGetLastWin32Error();
int RtlSetLastWin32Error(int dwErrCode);
#import "kernel32.dll"int DeleteFileW (string lpFileName);
int CloseHandle(int hObject);
int CreateFileW( string lpFileName, int dwDesiredAccess,
int dwShareMode, int lpSecurityAttributes,
int dwCreationDisposition, int dwFlagsAndAttributes,
int hTemplateFile
);
int SetFilePointer(int hFile, int lDistanceToMove, int& lpDistanceToMoveHigh[], int dwMoveMethod);
int SetEndOfFile (int hFile);
int ReadFile(int hFile, ushort& lpBuffer[], int nNumberOfBytesToRead, int& lpNumberOfBytesRead[], int lpOverlapped);
int WriteFile(int hFile, int& lpBuffer[], int nNumberOfBytesToWrite, int& lpNumberOfBytesWritten[], int lpOverlapped);
int GetFileSize(int hFile, int notUsed = 0);
int FindFirstFileW(string path, int& answer[]);
int FindNextFileW(int handle, int& answer[]);
int FindClose(int handle);
int CreateDirectoryW(string path, int securityAttributes /*set to 0*/);
#import
#define F_GENERIC_WRITE 0x40000000// Доступ к файлу для записи.constuint F_GENERIC_READ = 0x80000000; // Доступ к файлу для чтения.// ---- Параметр "dwShareMode".#define F_FILE_SHARE_NO 0x00000000// Запрещает процессы открытия файла.#define F_FILE_SHARE_READ 0x00000001// Подготавливает работу без ограничений в файле или устройстве для чтения.#define F_FILE_SHARE_WRITE 0x00000002// Подготавливает работу без ограничений в файле или устройстве для записи.#define F_FILE_SHARE_DELETE 0x00000004// Подготавливает работу без ограничений в файле или устройстве для удаления. // ---- Параметр "dwCreationDisposition".#define F_CREATE_NEW 1// Создает новый файл, если его ещё нет. Если файл есть, будет ошибка.#define F_CREATE_ALWAYS 2// Создает новый файл, всегда.#define F_OPEN_EXISTING 3// Открывает файл или устройство, если он существует.#define F_OPEN_ALWAYS 4// Открывает файл, всегда.#define F_TRUNCATE_EXISTING 5// Открывает файл и исключает это чтобы размер - нулевые байты, только если он существует.//==== Константы для функции "SetFilePointer()".#define F_FILE_BEGIN 0// От начала файла.#define F_FILE_CURRENT 1// От текущей позиции.#define F_FILE_END 2// От конца файла.#define INVALID_SET_FILE_POINTER -1#define INVALID_FILE_ATTRIBUTES -1#define INVALID_HANDLE_VALUE -1#define INVALID_FILE_SIZE 0xFFFFFFFF#define FILE_ATTRIBUTE_DIRECTORY 0x10#define ERROR_FILE_NOT_FOUND 2#define ERROR_PATH_NOT_FOUND 3string StringFromBuffer(int& buffer[])
{
string text = "";
for (int pos = 11; pos < 75; pos++)
{
int curr = buffer[pos];
text = text +
CharToString(uchar(curr & 0x000000FF)) +
CharToString(uchar(curr >> 8 & 0x000000FF)) +
CharToString(uchar(curr >> 16 & 0x000000FF)) +
CharToString(uchar(curr >> 24 & 0x000000FF));
}
return (text);
}
int GetFileList(string path, string filter, string& list[])
{
int Win32Data[80];
ArrayInitialize(Win32Data, 0);
RtlSetLastWin32Error(0);
int hFind = FindFirstFileW(path + filter, Win32Data);
if (INVALID_HANDLE_VALUE == hFind)
{
return (RtlGetLastWin32Error());
}
ArrayResize(list, 0);
if ((Win32Data[0] & FILE_ATTRIBUTE_DIRECTORY) == 0) // if found item is file, not directory
{
ArrayResize(list, 1);
list[0] = StringFromBuffer(Win32Data);
}
ArrayInitialize(Win32Data, 0);
while (FindNextFileW(hFind, Win32Data) != 0)
{
if ((Win32Data[0] & FILE_ATTRIBUTE_DIRECTORY) == 0) // if found item is file, not directory
{
int size = ArraySize(list);
ArrayResize(list, size + 1);
list[size] = StringFromBuffer(Win32Data);
}
ArrayInitialize(Win32Data, 0);
}
FindClose(hFind);
return (0);
}
int TryToCaptureFile(string fileName, int& err)
{
RtlSetLastWin32Error(0);
int hFile = CreateFileW(fileName, F_GENERIC_WRITE | F_GENERIC_READ, F_FILE_SHARE_NO, 0, F_OPEN_ALWAYS, 0, 0);
err = RtlGetLastWin32Error();
return (hFile);
}
bool CheckDirectoryExists(string path)
{
int Win32Data[80];
ArrayInitialize(Win32Data, 0);
RtlSetLastWin32Error(0);
int hFind = FindFirstFileW(path, Win32Data);
if (INVALID_HANDLE_VALUE == hFind)
{
return (false);
}
FindClose(hFind);
return ((Win32Data[0] & FILE_ATTRIBUTE_DIRECTORY) != 0); // if found item is directory
}
string LockFileName = "VolumeDataReceiver";
int hLockFile;
string ClusterDeltaPath;
string LockPath;
int UpdateIntervalSec;
int CheckLock()
{
int err = 0;
if (INVALID_HANDLE_VALUE != hLockFile) return (0);
string path = StringSubstr(LockPath, 0, StringLen(LockPath) - 1);
bool exists = CheckDirectoryExists(path);
if (!exists)
{ // try to create if not available
RtlSetLastWin32Error(0);
int res = CreateDirectoryW(LockPath, 0);
if (res == 0)
{
err = RtlGetLastWin32Error();
if (err != 183) // ERROR_ALREADY_EXISTS
{
Print("Failed to create directory -- \"", LockPath, "\"");
}
return (err);
}
}
if (INVALID_HANDLE_VALUE == hLockFile)
{
return (err);
}
return (0);
}
intOnInit()
{
if (!MQL5InfoInteger(MQL5_DLLS_ALLOWED) )
{
Alert("Dlls are not allowed. You should allow dll imports.");
return (1);
}
hLockFile = INVALID_HANDLE_VALUE;
ClusterDeltaPath = TerminalInfoString(TERMINAL_DATA_PATH) + "\\ClusterDelta\\Volume\\";
LockPath = TerminalInfoString(TERMINAL_DATA_PATH) + "\\ClusterDelta\\";
if (UpdateIntervalSec < 30)
{
UpdateIntervalSec = 30;
}
int err = CheckLock();
if (err != 0)
{
Alert("Failed initializing (Data Receiver already running?), error = ", err);
return (1);
}
return (0);
}
Le code (expert) est en train de bousiller le terminal 64... Développeurs, à l'aide ! #956630
regarder dans MSDN, où sont les poignées ou les pointeurs - ajouter des versions à long
Je fais ça.
#import "kernel32.dll"int CloseHandle(int hObject);
int CloseHandle(long hObject);
#import
int CloseHandle(long hObject)
{
if (_Is64) return(kernel32:: CloseHandle(hObject));
elsereturn(kernel32:: CloseHandle((int)hObject));
}
в коде
::CloseHandle(h); // где h - long типа
Merci, je l'ai. Je pense avoir regardé les pointeurs, mais j'avais oublié les poignées. Et il se brise d'une telle manière que vous ne pouvez pas dire ce qui le cause...
Si vous n'avez pas de compte, veuillez vous inscrire
Autorisez l'utilisation de cookies pour vous connecter au site Web MQL5.com.
Veuillez activer les paramètres nécessaires dans votre navigateur, sinon vous ne pourrez pas vous connecter.
Vous êtes connecté. L'authentification à deux facteurs a été désactivée. Configurez-la à nouveau et scannez un nouveau code QR, ou continuez avec l'authentification à deux facteurs désactivée.
1) Quelle est exactement la version courante du terminal déjà installé ?
2) Quel type de processeur avez-vous ? Supporte-t-il les instructions SSE2 ?
Désolé, pas de réponse depuis longtemps, ça a été beaucoup de travail.
1. la version du terminal 4.0 ticket 509 est installée.
2. Processeur AMD Duron 1.2 GHz Les instructions SSE sont supportées SSE2 n'est pas supporté...
Désolé de ne pas avoir répondu depuis longtemps, j'ai été très occupé.
1. la version du terminal 4.0 ticket 509 est installée.
2. Processeur AMD Duron 1.2 GHz Les instructions SSE sont supportées SSE2 n'est pas supporté...
Il est dit dans l'aide :
FACTEUR DE RÉCUPÉRATION DES DONNÉES
Le facteur de récupération est le rapport STAT_PROFIT/STAT_BALANCE_DD
Peut-être que l'aide devrait être corrigée. Je l'ai vérifié. Le facteur de récupération est calculé au moyen.
Le code (expert) est en train de bousiller le terminal 64... Développeurs, à l'aide ! #956630
Le code (expert) est en train de bousiller le terminal 64... Développeurs, à l'aide ! #956630
Le code (expert) est en train de bousiller le terminal 64... Développeurs, à l'aide ! #956630
regarder dans MSDN, où sont les poignées ou les pointeurs - ajouter des versions à long
Je fais ça.
Les panneaux indicateurs semblent avoir été examinés.
int lpOverlapped ???