실수로 고통받는 거래가 없습니다. - 페이지 8

 
Artyom, 나는 당신을 개인적으로 매우 존경합니다. 프로그래머가 이 문제에 주의를 기울이십시오. NZDUSD 부분의 유효성 검사기에 무엇이 잘못되었는지 확신합니다. 이야기가 없거나 그런 게 있을지도 모릅니다. 내가 틀릴 수도 있지만 모든 것을 확인하는 것은 불필요한 일이 아닙니다.
 
Artyom Trishkin :

유효성 검사기는 매개변수를 반복합니다. 거래가 없는 첫 번째 조합을 만나면 Expert Advisor를 언로드합니다. 모든 것. 더 이상의 테스트는 무의미합니다.

결론은 검증인이 전문가와 협력하지 못하게 하는 것입니다.

일부 기호에 대한 거래가 없더라도 테스트는 통과합니다. 가장 중요한 것은 거래 작업을 실행할 수 없는 경우 Expert Advisor가 이에 대한 로그 항목을 발행하고 계속 작업해야 한다는 것입니다.
당신은 검증인이 아닌 사람들을 위한 프로그램을 만들고 있습니다. 오류를 처리하지 않지만 차트에서 어리석게 제거되는 프로그램이 시장에 있는 이유는 무엇입니까? 그런 기적을 스스로 사시겠습니까?

Artyom, 테스트 EA(검증 확인중이고 팔지않음)이고, 업로드 조건만 맞으면 여전히 거래가 되지 않습니다. 거래를 열 수 없는 최소 로트에서는 단순히 인쇄로 로그 파일을 막힐 것입니다. 추가 작업에서 의미가 없습니다.

언로드를 제거하지만 아무 것도 변경되지 않습니다. 업로드하지 않고 EA를 확인한 결과는 이전 게시물을 참조하십시오.

 
Andrey Kaunov :

무슨 소리야, 레나트. 글쎄, 차를 몰았다

예, 오류 없이 작동합니다.

여기, 시장이 그랬기 때문에

//+-------------- ФУНКЦИЯ ОБРАБОТКИ ОШИБОК ---------------------------------+
int Fun_Error(int Error)
{  
   switch(Error)
   {
        case 0:      return (0);
        case 1:      Print("Trying to change already set values with the same values.");return(1);
        case 2:      Print("Common mistake. Stop all trading attempts until the circumstances are clarified.");return(0);
        case 3:      Print("Wrong parameters passed to the trading function.");return(1);
        case 4:      Print("The trading server is busy. Let's try again ..");Sleep(3000);return(1);
        case 5:      Print("Old version of the client terminal.");return(0);
        case 6:      Print("No connection to the trading server.");return(1);
        case 7:      Print("Not enough rights.");return(1);
        case 8:      Print("Too frequent requests.");return(1);
        case 9:      Print("Invalid operation disrupting server operation.");return(1);
        case 64:     Print("The account is blocked. It is necessary to stop all attempts at trading operations.");return(0);
        case 65:     Print("Invalid account number.");return(1);
        case 128:    Print("The transaction has expired.");return(1);
        case 129:    Print("Wrong bid or ask price, possibly not normalized price.");return(1);
        case 130:    Print("Stops that are too close or incorrectly calculated or abnormal prices in stops (or in the opening price of a pending order).");return(1);
        case 131:    Print("Wrong volume, error in granulation of volume.");return(1);
        case 132:    Print("The market is closed.");return(1);
        case 133:    Print("Trade is prohibited.");return(0);
        case 134:    Print("Not enough money to complete the operation.");return(0);
        case 135:    Print("The price has changed. We try again ..");RefreshRates();return(1);
        case 136:    Print("No price. We are waiting for a new tick ..");
                     while(RefreshRates()==false)// До нового тика
                     Sleep(1);
                     return(1);
        case 137:    Print("The broker is busy. Let's try again ..");Sleep(3000);return(1);
        case 138:    Print("The requested price is out of date, or bid and ask are confused.");return(1);
        case 139:    Print("The order is blocked and is already being processed.");return(1);
        case 140:    Print("Only purchase allowed. You cannot repeat the SELL operation.");return(1);
        case 141:    Print("Too many requests.");return(1);
        case 142:    Print("The order is queued.");return(1);
        case 143:    Print("The order has been accepted by the dealer for execution.");return(1);
        case 144:    Print("The order is canceled by the client upon manual confirmation of the transaction.");return(1);
        case 145:    Print("Modification is prohibited, because the order is too close to the market and is blocked due to possible early execution.");return(1);
        case 146:    Print("The trading subsystem is busy. Let's try again ..");Sleep(500);return(1);
        case 147:    Print("Using the expiration date of the order is prohibited by the broker.");return(1);
        case 148:    Print("The number of open and pending orders has reached the limit set by the broker.");return(1);
        case 149:    Print("An attempt to open an opposite position to an existing one if hedging is prohibited.");return(1);
        case 4000:   return (0);
        case 4001:   Print("Invalid function pointer.");return(1);
        case 4002:   Print("Array index is out of range.");return(1);
        case 4003:   Print("No memory for function stack.");return(1);
        case 4004:   Print("Stack overflow after recursive call.");return(1);
        case 4005:   Print("There is no memory on the stack for passing parameters.");return(1);
        case 4006:   Print("There is no memory for the string parameter.");return(1);
        case 4007:   Print("There is no memory for the time line.");return(1);
        case 4008:   Print("Uninitialized string.");return(1);
        case 4009:   Print("An uninitialized string in an array.");return(1);
        case 4010:   Print("There is no memory for the string array.");return(1);
        case 4011:   Print("Line is too long.");return(1);
        case 4012:   Print("The remainder of division by zero.");return(1);
        case 4013:   Print("Division by zero.");return(1);
        case 4014:   Print("Unknown team.");return(1);
        case 4015:   Print("Wrong transition.");return(1);
        case 4016:   Print("Uninitialized array.");return(1);
        case 4017:   Print("DLL calls are not allowed.");return(1);
        case 4018:   Print("Unable to load library.");return(1);
        case 4019:   Print("Unable to call function.");return(1);
        case 4020:   Print("Calls to external library functions are not allowed.");return(1);
        case 4021:   Print("There is not enough memory for the string returned from the function.");return(1);
        case 4022:   Print("The system is busy.");return(1);
        case 4050:   Print("Incorrect number of function parameters.");return(1);
        case 4051:   Print("Invalid function parameter value.");return(1);
        case 4052:   Print("Internal error of string function.");return(1);
        case 4053:   Print("Array error.");return(1);
        case 4054:   Print("Misuse of timeseries array.");return(1);
        case 4055:   Print("Custom indicator error.");return(1);
        case 4056:   Print("Arrays are incompatible.");return(1);
        case 4057:   Print("Error processing global variables.");return(1);
        case 4058:   Print("Global variable not detected.");return(1);
        case 4059:   Print("Function not allowed in test mode.");return(1);
        case 4060:   Print("Enter the HTTP address !!!.");return(1);
        case 4061:   Print("Error sending mail.");return(1);
        case 4062:   Print("A parameter of type string is expected.");return(1);
        case 4063:   Print("A parameter of type integer is expected.");return(1);
        case 4064:   Print("A parameter of type double is expected.");return(1);
        case 4065:   Print("An array is expected as a parameter.");return(1);
        case 4066:   Print("The requested historical data is in an update state.");return(1);
        case 4067:   Print("An error occurred while performing a trading operation.");return(1);
        case 4099:   Print("End of file.");return(1);
        case 4100:   Print("An error occurred while working with the file.");return(1);
        case 4101:   Print("Invalid file name.");return(1);
        case 4102:   Print("Too many open files.");return(1);
        case 4103:   Print("Unable to open file.");return(1);
        case 4104:   Print("Incompatible file access mode.");return(1);
        case 4105:   Print("No order has been selected.");return(1);
        case 4106:   Print("Unknown character.");return(1);
        case 4107:   Print("Incorrect price parameter for the trading function.");return(1);
        case 4108:   Print("Invalid ticket number.");return(1);
        case 4109:   Print("Trading is not permitted. You must enable the option Allow Expert Advisor to trade in the expert properties.");return(1);
        case 4110:   Print("Long positions are not allowed. It is necessary to check the properties of the expert.");return(1);
        case 4111:   Print("Short positions are not allowed. It is necessary to check the properties of the expert.");return(1);
        case 4200:   Print("The object already exists.");return(1);
        case 4201:   Print("An unknown property of the object was requested.");return(1);
        case 4202:   Print("The object does not exist.");return(1);
        case 4203:   Print("Unknown object type.");return(1);
        case 4204:   Print("No object name.");return(1);
        case 4205:   Print("Error coordinates of the object.");return(1);
        case 4206:   Print("The specified subwindow was not found.");return(1);
        case 4207:   Print("An error occurred while working with the object.");return(1);
        return(0);
   }
   return(0);
}

 

나는 다음과 같이 걸었다.

            ticket=OrderSend(Symbol(),OP_SELL,Lot,BID,0,0,0,"",0,0,clrNONE);
            if(ticket<0 && Fun_Error(GetLastError())==1){return;}

//---
           
            ticket=OrderSend(Symbol(),OP_BUY,Lot,ASK,0,0,0,"",0,0,clrNONE);
            if(ticket<0 && Fun_Error(GetLastError())==1){return;}

 

시도하십시오. 오류가 발생할 수 있습니다.

 
고마워요 레나트. 유용한 것. 내가 할게요)))
 
Andrey Kaunov :

Artyom, 이것은 테스트 EA이며 언로드 조건을 해결할 때 여전히 거래를하지 않습니다. 거래를 열 수 없는 최소 로트에서는 단순히 인쇄로 로그 파일을 막힐 것입니다. 추가 작업에서 의미가 없습니다.

언로드를 제거하지만 아무 것도 변경되지 않습니다. 업로드하지 않고 EA를 확인한 결과는 이전 게시물을 참조하십시오.

글쎄, 당신은 각각의 잘못된 거래 요청 에 대해 하나의 인스턴스를 기록할 수 없습니까?

 
Renat Akhtyamov :
예, 오류 없이 작동합니다.

여기, 시장이 했기 때문에

//+-------------- ФУНКЦИЯ ОБРАБОТКИ ОШИБОК ---------------------------------+

이것은 오류 처리가 아닙니다. 오류 코드에 대한 설명을 출력하고 있을 뿐입니다.

처리는 오류가 수신될 때 알고리즘을 실행하는 것입니다. 알고리즘은 오류 수정을 위한 조건을 만들고 두 번째 요청을 보내야 합니다. 이것을하는 것이 완전히 불가능한 경우 - 초기 매개 변수에 대해 저널에서 구독을 취소하고, 이러한 매개 변수를 수정하려고 시도하는 것과 최종 평결에 대해 - 조정 된 매개 변수를 사용하더라도 요청을 보낼 수 없습니다.

 
Andrey Kaunov :
고마워요 레나트. 유용한 것. 내가 할게요)))

가치가없는...

 
Artyom Trishkin :

이것은 오류 처리가 아닙니다. 오류 코드에 대한 설명을 출력하고 있을 뿐입니다.

처리는 오류가 수신될 때 알고리즘을 실행하는 것입니다. 알고리즘은 오류 수정을 위한 조건을 만들고 두 번째 요청을 보내야 합니다. 이것을하는 것이 완전히 불가능한 경우 - 초기 매개 변수에 대해 저널에서 구독을 취소하고, 이러한 매개 변수를 수정하려고 시도하는 것과 최종 평결에 대해 - 조정 된 매개 변수를 사용하더라도 요청을 보낼 수 없습니다.

그것으로 10년

불평하지 않는다

그건 그렇고, 첫 번째 중재자 중 한 명이 운전했습니다.

비닌, 이거 기억나?