"모든 제어 경로가 값을 반환하는 것은 아닙니다" 오류 - 페이지 2 1234 새 코멘트 Cristobal Giron 2018.07.16 13:29 #11 안녕하세요 친구, 저도 같은 문제가 있습니다 누군가 나를 도울 수 있습니까? double price; int slippage; double p = prce; int maxtry = RequoteAttempts; color CloseColor; OrderSelect (ticket, SELECT_BY_TICKET , MODE_TRADES ); int ordtype = OrderType (); if (ordtype == OP_BUY ) {price = NormalizeDouble ( Bid , Digits ); CloseColor = CloseBuyColor;} if (ordtype == OP_SELL ) {price = NormalizeDouble ( Ask , Digits ); CloseColor = CloseSellColor;} if ( MathAbs ( OrderTakeProfit () - price) <= MarketInfo ( Symbol (), MODE_FREEZELEVEL ) * Point ) return ( 0 ); if ( MathAbs ( OrderStopLoss () - price) <= MarketInfo ( Symbol (), MODE_FREEZELEVEL ) * Point ) return ( 0 ); if ( OrderClose (ticket, OrderLots (),price,CloseSlippage,CloseColor)) return ( 1 ); if (( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 )) return ( 0 ); Print ( "Requote" ); //--- RequoteAttempts) for ( int attempt = 1 ; attempt <= maxtry; attempt++) { RefreshRates (); if (ordtype == OP_BUY ) { slippage = MathRound (( Bid - p) / pp); if ( Bid >= p) { Print ( "Closing order. Attempt " + (attempt + 1 )); if ( OrderClose (ticket, OrderLots (), NormalizeDouble ( Bid , Digits ),slippage,CloseColor)) return ( 1 ); if (!(( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 ))) continue ; return ( 0 ); } } if (ordtype == OP_SELL ) { slippage = MathRound ((p - Ask ) / pp); if (p >= Ask ) { Print ( "Closing order. Attempt " + (attempt + 1 )); if ( OrderClose (ticket, OrderLots (), NormalizeDouble ( Ask , Digits ),slippage,CloseColor)) return ( 1 ); if (( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 )) return ( 0 ); } } } } Keith Watford 2018.07.16 15:39 #12 관련 코드를 복사하여 붙여넣습니다. 이미지에서 함수 의 시작을 표시하지 않았으므로 반환해야 할 내용을 알 수 없습니다. 어쨌든 함수의 끝에 반환이 있어야 합니다. William Roeder 2018.07.16 18:37 #13 이 포럼에 영어로 게시하십시오. 필요한 경우 자동 번역 도구 를 사용하십시오. 기계 번역 을 사용할 때 간단한 언어 구조를 사용하십시오. 코드 이미지를 게시하지 마십시오. 코드를 게시할 때 CODE 버튼(Alt-S)을 사용하십시오! (코드 양이 많을 경우 첨부해 주세요. ) (원본) 게시물을 수정 해주세요. 포럼의 일반 규칙 및 모범 사례. - 일반 - MQL5 프로그래밍 포럼 메시지 편집기 Cristobal Giron 2018.07.16 20:01 #14 감사하고 죄송합니다. 모두 해결되었습니다. Cristobal Giron 2018.07.17 11:43 #15 Keith Watford : Copie y pegue el codigo relatede. A partir de su imagen, no ha mostrado el comienzo de la función , por lo que no sabemos qué debería devolver. 모든 작업을 수행하고 기능을 최종적으로 사용할 수 있습니다. 안녕하세요 친구 이제 코드에 문제가 있음을 알 수 있습니까? JermyRec 2018.07.17 12:27 #16 if(OrderSelect... Cristobal Giron 2018.07.17 12:34 #17 JermyRec : 이해가 안가는 친구 Keith Watford 2018.07.18 16:56 #18 int CloseOrder( int ticket, double prce){ //+--------------------------------------------------------------------------------------------------------------+ double price; int slippage; double p = prce; int maxtry = RequoteAttempts; color CloseColor; OrderSelect (ticket, SELECT_BY_TICKET , MODE_TRADES ); int ordtype = OrderType (); if (ordtype == OP_BUY ) {price = NormalizeDouble ( Bid , Digits ); CloseColor = CloseBuyColor;} if (ordtype == OP_SELL ) {price = NormalizeDouble ( Ask , Digits ); CloseColor = CloseSellColor;} if ( MathAbs ( OrderTakeProfit () - price) <= MarketInfo ( Symbol (), MODE_FREEZELEVEL ) * Point ) return ( 0 ); if ( MathAbs ( OrderStopLoss () - price) <= MarketInfo ( Symbol (), MODE_FREEZELEVEL ) * Point ) return ( 0 ); if ( OrderClose (ticket, OrderLots (),price,CloseSlippage,CloseColor)) return ( 1 ); if (( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 )) return ( 0 ); Print ( "Requote" ); //--- RequoteAttempts) for ( int attempt = 1 ; attempt <= maxtry; attempt++) { RefreshRates (); if (ordtype == OP_BUY ) { slippage = MathRound (( Bid - p) / pp); if ( Bid >= p) { Print ( "Closing order. Attempt " + (attempt + 1 )); if ( OrderClose (ticket, OrderLots (), NormalizeDouble ( Bid , Digits ),slippage,CloseColor)) return ( 1 ); if (!(( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 ))) continue ; return ( 0 ); } } if (ordtype == OP_SELL ) { slippage = MathRound ((p - Ask ) / pp); if (p >= Ask ) { Print ( "Closing order. Attempt " + (attempt + 1 )); if ( OrderClose (ticket, OrderLots (), NormalizeDouble ( Ask , Digits ),slippage,CloseColor)) return ( 1 ); if (( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 )) return ( 0 ); } } } } In this line would be the error ( ')' - not all control paths return to value) 중재자 : 다른 스레드에서 복사 Keith Watford 2018.07.18 17:01 #19 int CloseOrder( int ticket, double prce){ //+--------------------------------------------------------------------------------------------------------------+ double price; int slippage; double p = prce; int maxtry = RequoteAttempts; color CloseColor; OrderSelect (ticket, SELECT_BY_TICKET , MODE_TRADES ); int ordtype = OrderType (); if (ordtype == OP_BUY ) {price = NormalizeDouble ( Bid , Digits ); CloseColor = CloseBuyColor;} if (ordtype == OP_SELL ) {price = NormalizeDouble ( Ask , Digits ); CloseColor = CloseSellColor;} if ( MathAbs ( OrderTakeProfit () - price) <= MarketInfo ( Symbol (), MODE_FREEZELEVEL ) * Point ) return ( 0 ); if ( MathAbs ( OrderStopLoss () - price) <= MarketInfo ( Symbol (), MODE_FREEZELEVEL ) * Point ) return ( 0 ); if ( OrderClose (ticket, OrderLots (),price,CloseSlippage,CloseColor)) return ( 1 ); if (( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 )) return ( 0 ); Print ( "Requote" ); //--- RequoteAttempts) for ( int attempt = 1 ; attempt <= maxtry; attempt++) { RefreshRates (); if (ordtype == OP_BUY ) { slippage = MathRound (( Bid - p) / pp); if ( Bid >= p) { Print ( "Closing order. Attempt " + (attempt + 1 )); if ( OrderClose (ticket, OrderLots (), NormalizeDouble ( Bid , Digits ),slippage,CloseColor)) return ( 1 ); if (!(( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 ))) continue ; return ( 0 ); } } if (ordtype == OP_SELL ) { slippage = MathRound ((p - Ask ) / pp); if (p >= Ask ) { Print ( "Closing order. Attempt " + (attempt + 1 )); if ( OrderClose (ticket, OrderLots (), NormalizeDouble ( Ask , Digits ),slippage,CloseColor)) return ( 1 ); if (( GetLastError () != 135 ) && ( GetLastError () != 138 ) && ( GetLastError () != 146 )) return ( 0 ); } } } return (- 1 ); /// not all branching code in the function return values } 진행자 : 다른 스레드에서 복사한 Vitalii Anaev 의 회신 Keith Watford 2018.07.18 17:04 #20 이중 게시하지 마십시오. 여기에서 답장을 받았는데 왜 정확히 같은 주제로 새 주제를 여세요. 이것은 단지 이기적이며 당신을 도우려는 사람들의 시간을 낭비합니다. 다른 주제를 삭제했습니다. 1234 새 코멘트 트레이딩 기회를 놓치고 있어요: 무료 트레이딩 앱 복사용 8,000 이상의 시그널 금융 시장 개척을 위한 경제 뉴스 등록 로그인 공백없는 라틴 문자 비밀번호가 이 이메일로 전송될 것입니다 오류 발생됨 Google으로 로그인 웹사이트 정책 및 이용약관에 동의합니다. 계정이 없으시면, 가입하십시오 MQL5.com 웹사이트에 로그인을 하기 위해 쿠키를 허용하십시오. 브라우저에서 필요한 설정을 활성화하시지 않으면, 로그인할 수 없습니다. 사용자명/비밀번호를 잊으셨습니까? Google으로 로그인
안녕하세요 친구, 저도 같은 문제가 있습니다 누군가 나를 도울 수 있습니까?
관련 코드를 복사하여 붙여넣습니다. 이미지에서 함수 의 시작을 표시하지 않았으므로 반환해야 할 내용을 알 수 없습니다.
어쨌든 함수의 끝에 반환이 있어야 합니다.
포럼의 일반 규칙 및 모범 사례. - 일반 - MQL5 프로그래밍 포럼
메시지 편집기
Copie y pegue el codigo relatede. A partir de su imagen, no ha mostrado el comienzo de la función , por lo que no sabemos qué debería devolver.
모든 작업을 수행하고 기능을 최종적으로 사용할 수 있습니다.
안녕하세요 친구 이제 코드에 문제가 있음을 알 수 있습니까?
if(OrderSelect...
이해가 안가는 친구
중재자 : 다른 스레드에서 복사
진행자 : 다른 스레드에서 복사한 Vitalii Anaev 의 회신
이중 게시하지 마십시오. 여기에서 답장을 받았는데 왜 정확히 같은 주제로 새 주제를 여세요. 이것은 단지 이기적이며 당신을 도우려는 사람들의 시간을 낭비합니다.
다른 주제를 삭제했습니다.