orderopenprice가 열린 후 가장 높은 값을 얻으려면 어떻게 해야 합니까? - 페이지 6

[삭제]  

나는 첫 번째 문제를 수정했습니다 (나는 오류를 만들었습니다. 감사합니다 diostar )

// if(OrdersTotal()>0){
if ( ((lastOpenedOpenPriceBuy()-0.0030)>MarketInfo("EURUSD",MODE_BID)) )
{ SELL("EURUSD",S_EURUSD_LS_1,S_EURUSD_TP_1,S_EURUSD_SL_1,S_EURUSD_TS_1,"if ( ( (lastOpenedOpenPriceBuy()-0.0030>MarketInfo(EURUSD,MODE_BID) ) )" ) ;}
}

두 번째 경우:

if ( ((lastOpenedOpenPriceBuy()-lastOpenedOpenPriceSell() )>=0.0060) &&( lastClosedClosePrice()<beforelastClosedClosePrice()) )
{ 닫기("EURUSD") ;}

나는 무엇을 해야 할지 모르겠다:
참고로 CLOSESHORT 기능 은 다음과 같습니다.

int CLOSESHORT(문자열 symbol_c) {
CloseAllPositions(symbol_c,OP_SELL,MagicNumberShort);
CloseAllPositions(symbol_c,OP_SELL,MagicNumberShort);
반환(0);
}

감사해요

 

나는 지금 혼란스럽다.

lastOpenedOpenPriceBuy() 첫 번째 기능 에 대해 답장을 하고 있습니까?

지금은 그 정도 밖에 처리할 수 없습니다. 그래서, 당신이 정확히 무엇을 수정했습니다. 지금 코드는 어떻습니까?

 
diostar :

나는 지금 혼란스럽다.

당신은 유일한 사람이 아닙니다. . 시간을 낭비하지 마세요.
 
RaptorUK :
당신은 유일한 사람이 아닙니다. . 시간을 낭비하지 마세요.

이 스레드는 아마도 가장 긴 스레드 중 하나일 것입니다. 그리고 6페이지 후, 혼란스럽습니다. 아니요, 나는 여전히 그것이 "낭비"가 아니라고 말합니다.

(새로운 방향, 새로운 삶, 새로운 시작을 위한 시간을 의미합니다. 모두를 위한 것입니다.)

 
이 스레드에서도 시간을 보냈고 코드를 추가 하고 제안했습니다. . . 말을 물가로 끌고 갈 때 건초로 맛을 내고 사과를 조금 넣어도 말은 여전히 물을 마시고 싶어하지 않는다는 사실을 깨달을 때입니다. . . 그것은 물 섭취를 위해 정맥 주사를 원합니다. . . 그 시점에서 내가 염려하는 한 말은 혼자 있습니다.
 
RaptorUK :
이 스레드에서도 시간을 보냈고 코드를 추가하고 제안했습니다. . . 말을 물가로 끌고 갈 때 건초로 맛을 내고 사과를 조금 넣어도 말은 여전히 물을 마시고 싶어하지 않는다는 사실을 깨달을 때입니다. . . 그것은 물 섭취를 위해 정맥 주사를 원합니다. . . 그 시점에서 내가 염려하는 한 말은 혼자 있습니다.

알겠어요. 말에게 영양을 공급하는 것과 같이 최종 보상은 "운명적"이지 않을 수 있습니다. 그런 다음 시도한 사람들에 대한 보상은 다른 것이어야 합니다.

그 말에 감사드립니다.

[삭제]  

도와 주신 diostar님 감사합니다.

이제 버그를 85% 수정했습니다. 우리에게 보여줘:

1- 우리는 4개의 함수 를 만들었습니다(이 페이지 끝에서 참조하십시오)

*lastOpenedOpenPriceBuy()

* lastOpenedOpenPriceSell()

*lastClosedClosePrice()
*beforelastClosedClosePrice()

2- 우리는 다음을 사용할 때 첫 번째 문제에 직면했습니다.

 if (  ((lastOpenedOpenPriceBuy()- 0.0030 )> MarketInfo ( "EURUSD" ,MODE_BID))  ) 
   {  SELL( "EURUSD" ,S_EURUSD_LS_1,S_EURUSD_TP_1,S_EURUSD_SL_1,S_EURUSD_TS_1, "if (  ( (lastOpenedOpenPriceBuy()-0.0030)>MarketInfo(EURUSD,MODE_BID) )  )" ) ;}
   if (  ((lastOpenedOpenPriceSell()+ 0.0030 )< MarketInfo ( "EURUSD" ,MODE_BID))  ) 
   {  BUY( "EURUSD" ,B_EURUSD_LS_1,B_EURUSD_TP_1,B_EURUSD_SL_1,B_EURUSD_TS_1, "if (  ( (lastOpenedOpenPriceSell()+0.0030)<MarketInfo(EURUSD,MODE_BID) )  )" ) ;}

다음을 추가하여 수정합니다.

 if ( OrdersTotal ()> 0 ){
   if (  ((lastOpenedOpenPriceBuy()- 0.0030 )> MarketInfo ( "EURUSD" ,MODE_BID))  ) 
   {  SELL( "EURUSD" ,S_EURUSD_LS_1,S_EURUSD_TP_1,S_EURUSD_SL_1,S_EURUSD_TS_1, "if (  ( (lastOpenedOpenPriceBuy()-0.0030)>MarketInfo(EURUSD,MODE_BID) )  )" ) ;}
   if (  ((lastOpenedOpenPriceSell()+ 0.0030 )< MarketInfo ( "EURUSD" ,MODE_BID))  ) 
   {  BUY( "EURUSD" ,B_EURUSD_LS_1,B_EURUSD_TP_1,B_EURUSD_SL_1,B_EURUSD_TS_1, "if (  ( (lastOpenedOpenPriceSell()+0.0030)<MarketInfo(EURUSD,MODE_BID) )  )" ) ;}
   }

3- 두 번째 문제는 다음과 같습니다.

 if ( ((lastOpenedOpenPriceBuy()-lastOpenedOpenPriceSell())>= 0.0060 )&&(((lastOpenedOpenPriceBuy()+lastOpenedOpenPriceSell())/ 2 )< MarketInfo ( "EURUSD" ,MODE_BID))
         &&(lastClosedClosePrice()< beforelastClosedClosePrice()) )  
   {  CLOSESHORT( "EURUSD" ) ;}

&&(lastClosedClosePrice()< beforelastClosedClosePrice()) 제거하면 . 그러면 모든 것이 잘 될 것입니다

문제 없음:

*(((lastOpenedOpenPriceBuy()-lastOpenedOpenPriceSell())>= 0.0060 )

*(((lastOpenedOpenPriceBuy()+lastOpenedOpenPriceSell())/ 2 )< MarketInfo ( "EURUSD" ,MODE_BID))

&&(lastClosedClosePrice()< beforelastClosedClosePrice()) 와 관련된 유일한 문제

예를 들어:

주문 번호 5가 열리고 매도인 경우 주문 번호 6이 열리고 닫히고 주문이 매수이고 주문 번호 7이 열리고 매수되었습니다.

사례는 (lastClosedClosePrice()< beforelastClosedClosePrice())입니다.

( 주문 번호 6 < 주문 번호 4 ) // 주문 번호 5가 아직 마감되지 않았기 때문입니다.

어떻게 해야 합니까? 모르겠어요. if ( OrdersHistoryTotal ()> 0 ){ 모든 조건을 삽입하지만 방법은 없습니다 }

 double lastOpenedOpenPriceBuy()
  {
   double ret = 0 ;
   datetime time= 0 ;
   for ( int i= 0 ; i< OrdersTotal (); i++) {
       OrderSelect (i, SELECT_BY_POS, MODE_TRADES);
       if ( OrderType ()==OP_BUY && OrderOpenTime ()>time) {
         time = OrderOpenTime ();
         ret = OrderOpenPrice ();
      }
   }
   
   return (ret);
  }


double lastOpenedOpenPriceSell()
  {
   double ret = 0 ;
   datetime time= 0 ;
   for ( int i= 0 ; i< OrdersTotal (); i++) {
       OrderSelect (i, SELECT_BY_POS, MODE_TRADES);
       if ( OrderType ()==OP_SELL && OrderOpenTime ()>time) {
         time = OrderOpenTime ();
         ret = OrderOpenPrice ();
      }
   }
   
   return (ret);
  }



double lastClosedClosePrice()
  {
   double ret = 0 ;
   datetime time = 0 ;
   for ( int i= OrdersHistoryTotal ()- 1 ; i>= 0 ; i--) {
       OrderSelect (i, SELECT_BY_POS, MODE_HISTORY);
       if ( OrderType ()< 2 && OrderCloseTime ()>time) {
         time = OrderCloseTime ();
         ret = OrderClosePrice ();
      }
   }
   
   return (ret);
  }


double beforelastClosedClosePrice()
  {
   double ret = 0 ;
   double ret2 = 0 ;
   datetime time = 0 ;
   for ( int i= OrdersHistoryTotal ()- 1 ; i>= 0 ; i--) {
       OrderSelect (i, SELECT_BY_POS, MODE_HISTORY);
       if ( OrderType ()< 2 && OrderCloseTime ()>time) {
         time = OrderCloseTime ();
         ret = ret2;
         ret2 = OrderClosePrice ();
      }
   }
   if (ret== 0 ) {
      ret = ret2;
   }
   
   return (ret);
  }
 
double lastOpenedOpenPriceBuy()
  {
   double ret = 0 ;
   datetime time= 0 ;
   for ( int i= 0 ; i< OrdersTotal (); i++) {
       OrderSelect (i, SELECT_BY_POS, MODE_TRADES);
       if ( OrderType ()==OP_BUY && OrderOpenTime ()>time) {
         time = OrderOpenTime ();
         ret = OrderOpenPrice ();
      }
   }
   
   return (ret);
  }

이것은 내가 제안한 것이 아니며 "우리"가 이것을 만들지 않았습니다. 이것은 100% 당신 것입니다.