[ARCHIVE] 포럼을 어지럽히 지 않도록 초보자 질문. 프로, 놓치지 마세요. 너 없이는 아무데도 - 5. - 페이지 351

 
Heroix :
그러나 당신은 빠릅니다. 때문에 게시물을 삭제했습니다. 스스로 찾았습니다. 고맙습니다!

구독을 취소하신건 좋은데, 그렇지 않으면 제가 못찾는 고대글에 답글을 드린줄 알았어요 :)
 
tara :
그러나 "도구 - 설정"메뉴의 "이벤트"탭에서는 모든 것이 매우 나쁩니다. 사용해보십시오 :(

동의합니다. 모든 것이 나쁩니다 ... 경고는 공간에 의해 꺼지지 않고 수동으로 만 ... "service-settings-events"에서 경고 매개 변수를 변경해도 아무 것도 표시되지 않습니다 ...
 

얘들아, 제발 말해줘 이미 이 질문을 했지만 코드를 떠올리는 것은 불가능했습니다.

다시 한 번 아이디어의 본질을 설명하겠습니다. Awesom 표시기에 따르면 낮은(0 미만)에서 위쪽(0 이상)까지 파도의 볼륨이 고려됩니다(볼륨 표시기).

웨이브별 볼륨의 텍스트 레이블은 지표 차트에 표시되어야 하며 전체 이력에 대해 계산되어야 합니다.

알 겠어:

쌀4

실수는 어디에 있습니까?

 #property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  Red
#property  indicator_color2  SteelBlue
#property  indicator_width1   2

//---- basic fan indicator parameters

extern bool Show_AOLine_2= true ;
extern int SlowEMA3= 34 ;
extern int EMA= 3 ;
extern bool Show_Volume= true ;
extern double coaf= 0.5 ;
//---- indicator buffers
double AOBuffer3[];
double ExtMapBuffer1[];


     double VLUP, AO_up,AO_dn;
     double prhgh_e= 0 , prhgh_s, prlw_e= 0 , prlw_s;
     datetime tmhgh, tmlw;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   //---- drawing settings
   
   string name_ind = "Awesome_super_volumes" ;
   IndicatorShortName( "Awesome_super_volumes" );
   
   
//---- AO_fan line 2 (basic)
   if (Show_AOLine_2 == true ){Show_AOLine_2= DRAW_LINE ; }
   else 
    {Show_AOLine_2= DRAW_NONE ; }
   SetIndexBuffer ( 0 ,AOBuffer3);
   SetIndexStyle( 0 ,Show_AOLine_2);
   SetIndexLabel( 0 , "basic line" );   

   SetIndexBuffer ( 1 ,ExtMapBuffer1);
   SetIndexStyle( 1 , DRAW_HISTOGRAM );
   SetIndexLabel( 1 , "Volume" );
   
   //---- initialization done
   return ( 0 );
  }
//+------------------------------------------------------------------+
//| Awesome Oscillator                                               |
//+------------------------------------------------------------------+
int start()
  {
  
   int     limit;
   int     counted_bars=IndicatorCounted();
   double prev,current;
//---- last counted bar will be recounted
   if (counted_bars> 0 ) counted_bars--;
   limit= Bars -counted_bars;

   for ( int i= 0 ; i<limit; i++)
   {
     
 //---- AO_fan + Volumes
     
AOBuffer3[i]= iMA ( NULL , 0 ,EMA, 0 , MODE_SMA , PRICE_MEDIAN ,i)- iMA ( NULL , 0 ,SlowEMA3, 0 , MODE_SMA , PRICE_MEDIAN ,i);
if (Show_Volume== true )
{
double nSum = Volume[i]* Point *coaf;
   if (AOBuffer3[i]<= 0 )ExtMapBuffer1[i] = nSum;
   if (AOBuffer3[i]> 0 )ExtMapBuffer1[i] = -nSum;


double Vol_Arr[];
   if (AOBuffer3[i]<= 0 )Vol_Arr[i]=Volume[i]* Point *coaf;
   if (AOBuffer3[i]> 0 )Vol_Arr[i] = -Volume[i]* Point *coaf;
}
}

   //-- Поиск High & Time & Min_AO   
   if (AOBuffer3[i]> 0 )
  {
    
  AO_up = AOBuffer3[i]* 0.1 +AOBuffer3[i];
  prhgh_s = High[i];
   if (prhgh_s >= prhgh_e) {prhgh_e = prhgh_s; tmhgh = Time[i];}
   //SetText("Awesome_super_volumes"+Close[i], DoubleToStr(VLUP,0), tmhgh, AO_up, Black);
  }   
   
   //-- Поиск Low & Time & Max_AO 
   if (AOBuffer3[i]< 0 )
  {
  AO_dn = AOBuffer3[i]* 0.1 +AOBuffer3[i];
  prlw_s = Low[i];
   if (prlw_s > prlw_e) {prlw_e = prlw_s; tmlw = Time[i];}
   //SetText("Awesome_super_volumes"+Close[i], DoubleToStr(VLUP,0), tmlw, AO_dn, Black);
  } 
  
    // -- Пересчет баров от High до Low
  
   if (NewBar())
{ 
int colbr = iBarShift( NULL , 0 ,tmhgh)-iBarShift( NULL , 0 ,tmlw);     
int shift=iBarShift( NULL , 0 ,tmhgh);
 for (i= 0 ; i<=colbr; i++)
{VLUP += MathAbs (iVolume( NULL , 0 , shift+i));}
}


    
   Comment ( "Vol_" ,VLUP,prlw_e,prhgh_e); 
   for (i= 0 ; i<limit; i++)
   {     
SetText( "Awesome_super_volumes" +Close[i], DoubleToStr(VLUP, 0 ), tmlw, AO_dn, Black);     
 }
        
//---- done
   return ( 0 );
  }
//+------------------------------------------------------------------+
void SetText( string name, string Vl, datetime t1, double p1, color c)
 {
 // if (ObjectFind(name)!=-1) ObjectDelete(name);
   ObjectCreate (name, OBJ_TEXT ,WindowFind( "Awesome_super_volumes" ), 0 , 0 , 0 , 0 );
  ObjectSetText(name, Vl, 10 , "Times New Roman" , c);
  ObjectSet(name, OBJPROP_TIME1 , t1);
  ObjectSet(name, OBJPROP_PRICE1, p1);
  ObjectSet(name, OBJPROP_COLOR , c); 
  }
  
   bool NewBar()
{
   static datetime lastbar = 0 ;
   datetime curbar = Time[ 0 ];
   if (lastbar!=curbar)
   {
      lastbar=curbar;
       return ( true );
   }
   else
   {
     return ( false );
   }}
 

Expert Advisor는 차트에 주문 팩을 던집니다.

내 기능은 공개 시장 주문, 보류 중인 구매 및 결제 수를 찾습니다. 한 가지 더 빠르게 확인하기 위해 여기에 또 다른 내장 함수를 추가했는데, 보류 중인 주문의 최대 가격과 최소 가격 값을 찾습니다.

프린트를 통해 어떤 시점에서 그 값들이 당신이 필요로 하는 것이 아님을 알게 된다.

요점은 보류 중인 주문이 이미 마감된 경우 건너뛸 필요가 있지만 어떤 이유로 함수가 건너뛰지 않는다는 것입니다. 기능은 다음과 같습니다.

 //+-------------------------------------------------------------------------------------+
//| Поиск своих ордеров                                                                 |
//+-------------------------------------------------------------------------------------+
void FindOrders()
{
   int total = OrdersTotal () - 1 ;
   
   amountOfCurrPendingBuys = 0 ;
   amountOfCurrPendingSells = 0 ;
   amountOfCurrMarketOrders = 0 ;
   
   priceMinOfBuy = 0 ;
   priceMaxOfSell = 0 ;

   for ( int i=total; i>= 0 ; i--)
   {
     if (! OrderSelect (i,SELECT_BY_POS,MODE_TRADES)) continue ;
         if (OrderSymbol() != Symbol ()) continue ;
           if (OrderMagicNumber() != i_magic) continue ;
           if (OrderCloseTime() != 0 ) continue ;
           {
               if (OrderType() == OP_BUYSTOP)
              {
                 amountOfCurrPendingBuys++;

                 if (priceMaxOfBuy < OrderOpenPrice() || priceMaxOfBuy == 0 )
                 {
                     priceMaxOfBuy = OrderOpenPrice();
                 }
                 if (priceMinOfBuy > OrderOpenPrice() || priceMinOfBuy == 0 )
                 {
                     priceMinOfBuy = OrderOpenPrice();
                 }
              }
               if (OrderType() == OP_SELLSTOP)
              {
                 amountOfCurrPendingSells++;

                 if (priceMaxOfSell < OrderOpenPrice() || priceMaxOfSell == 0 )
                 {
                     priceMaxOfSell = OrderOpenPrice();
                 }
                 if (priceMinOfSell > OrderOpenPrice() || priceMinOfSell == 0 )
                 {
                     priceMinOfSell = OrderOpenPrice();
                 }
              }
              amountOfCurrMarketOrders++;
           }
   }
   Print ( "FindOrders() : priceMaxOfBuy " , priceMaxOfBuy);
   Print ( "FindOrders() : priceMinOfBuy " , priceMinOfBuy);
   Print ( "FindOrders() : priceMaxOfSell " , priceMaxOfSell);
   Print ( "FindOrders() : priceMinOfSell " , priceMinOfSell);
   
   Print ( "FindOrders() : amountOfCurrPendingBuys " , amountOfCurrPendingBuys);
   Print ( "FindOrders() : amountOfCurrPendingSells " , amountOfCurrPendingSells);
   Print ( "FindOrders() : amountOfCurrMarketOrders " , amountOfCurrMarketOrders);
}

조건은 다음과 같이 명확하게 명시되어 있습니다.

 if (OrderCloseTime() != 0 ) continue ;

즉, 주문 마감 시간이 0이 아니면 마감되므로 건너뜁니다.

출력에서 누락되지 않았음을 알 수 있습니다. 차트는 다음과 같습니다.

연기 가격이 왜 안 맞나요? 내가 볼 수있는 한 코드가 정확합니다.

 
hoz :

조건은 다음과 같이 명확하게 명시되어 있습니다.

 if (OrderCloseTime() != 0 ) continue ;


그리고 연기된 이유는 무엇입니까?
 
Vinin :

그리고 연기된 이유는 무엇입니까?


따라서 활성 상태 인 예금의 경우 종가 는 논리적으로 0과 같으며(종료되지 않았기 때문에), 이미 마감된 예금의 경우 종가는 0이 아닙니다(종가는 시간 떠날 때) . 논리적으로, 지금이 마감 시간입니까?

나는 지연이 닫히지 않고 삭제된다는 것을 이해하지만 그것을 구현하는 다른 방법은 무엇입니까?

 
함수에서 필요한 것을 작성할 수 있습니까?
 
//+-------------------------------------------------------------------------------------+
//| Поиск своих ордеров                                                                 |
//+-------------------------------------------------------------------------------------+
void FindOrders()
{
   int total = OrdersTotal() - 1;
   
   amountOfCurrPendingBuys = 0;
   amountOfCurrPendingSells = 0;
   amountOfCurrMarketOrders = 0;
   
   priceMinOfBuy = 0;
   priceMaxOfSell = 0;

   for (int i=total; i>=0; i--)
   {
     if (!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
        if (OrderSymbol() != Symbol()) continue;
           if (OrderMagicNumber() != i_magic) continue;
           if (OrderCloseTime() != 0) continue;
           {// к чему относятся эти скобки ??? уберите их и if (OrderCloseTime() != 0) continue; наконец то заработает
              if (OrderType() == OP_BUYSTOP)
              {
                 amountOfCurrPendingBuys++;

                 if (priceMaxOfBuy < OrderOpenPrice() || priceMaxOfBuy == 0)
                 {
                     priceMaxOfBuy = OrderOpenPrice();
                 }
                 if (priceMinOfBuy > OrderOpenPrice() || priceMinOfBuy == 0)
                 {
                     priceMinOfBuy = OrderOpenPrice();
                 }
              }
              if (OrderType() == OP_SELLSTOP)
              {
                 amountOfCurrPendingSells++;

                 if (priceMaxOfSell < OrderOpenPrice() || priceMaxOfSell == 0)
                 {
                     priceMaxOfSell = OrderOpenPrice();
                 }
                 if (priceMinOfSell > OrderOpenPrice() || priceMinOfSell == 0)
                 {
                     priceMinOfSell = OrderOpenPrice();
                 }
              }
              amountOfCurrMarketOrders++;
           }
   }
   Print("FindOrders() : priceMaxOfBuy ", priceMaxOfBuy);
   Print("FindOrders() : priceMinOfBuy ", priceMinOfBuy);
   Print("FindOrders() : priceMaxOfSell ", priceMaxOfSell);
   Print("FindOrders() : priceMinOfSell ", priceMinOfSell);
   
   Print("FindOrders() : amountOfCurrPendingBuys ", amountOfCurrPendingBuys);
   Print("FindOrders() : amountOfCurrPendingSells ", amountOfCurrPendingSells);
   Print("FindOrders() : amountOfCurrMarketOrders ", amountOfCurrMarketOrders);
}
 
int i, buy_ticket,sell_ticket;
double min = Close[0];
double max = Close[0];
for(i = OrdersHistoryTotal()-1;i>=0;i--){
   if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
      if(OrderSymbol()!=Symbol()){continue;}
      if(OrderMagicNumber()!=Magic){continue;}
      if(OrderType()==OP_BUYSTOP){
         if(OrderOpenPrice()>max){
            max = OrderOpenPrice();
            buy_ticket = OrderTicket();
         }
      }
      if(OrderType()==OP_SELLSTOP){
         if(OrderOpenPrice()<min){
            min = OrderOpenPrice();
            sell_ticket = OrderTicket();
         }
      }
   }
}
if(OrderSelect(buy_ticket,SELECT_BY_TICKET){
   if(OrderCloseTime()==0){OrderDelete(OrderTicket());}
}
if(OrderSelect(sell_ticket,SELECT_BY_TICKET){
   if(OrderCloseTime()==0){OrderDelete(OrderTicket());}
}
 
FAQ :
함수에서 필요한 것을 작성할 수 있습니까?

극단적 인 예금의 가격을 찾으십시오. 원격이 아닌 활성입니다. 저것들. 나는 선택 중에 제거 된 예금을 건너 뛰기를 원합니다 .. 내가 명확하게 설명 했습니까?