MQL4 및 MQL5에 대한 초보자 질문, 알고리즘 및 코드에 대한 도움말 및 토론 - 페이지 1491

 
Alexey Viktorov :

그렇게 노골적으로 거짓말을 하는 것은 부적절합니다. 당신은 당신의 게시물을 삭제하고 당신의 무지를 다른 사람에게 쏟아 붓고 있습니다. 거짓말 쟁이.

무슨 메시지?
처음부터 나는 prev_calculated와 Rates_total에 대해서만 썼습니다.

귀하로부터 다음과 같은 답변을 받았습니다.

글쎄, 왜 그런 경험이 없는 프로그래머를 비웃는가?

그리고 누락된 이력이 로드되고 차이가 1보다 크면? 그러나 우리는 신경 쓰지 않습니다. 음, 한 마디를 건너 뛰자 ... 한 마디 더 - 하나 덜 생각하십시오. 그리고 설명도 없이 왜 코드를 주나요? 결국 무슨 일이 일어났는지 볼까요?

그래서 당신은 거짓말 쟁이입니다)

하나

 
Taras Slobodyanik :

예, 배열의 방향을 변경하거나 1 대신 Rates_total-2 인덱스를 가져와야 합니다.


추가 후

 ArraySetAsSeries (open, true );
ArraySetAsSeries (high, true );
ArraySetAsSeries (low, true );
ArraySetAsSeries (close, true );
ArraySetAsSeries (time, true );   

정확하게 결정

 2021.06 . 02 18 : 33 : 09.480 Test (Volatility 10 Index,M1)   Up
2021.06 . 02 18 : 34 : 09.479 Test (Volatility 10 Index,M1)   Dn

전체 코드:

 //+------------------------------------------------------------------+
//|                                                    test.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link        " https://www.mql5.com "
#property version    "1.00"
#property indicator_chart_window

#property indicator_buffers 2
#property indicator_plots    2

#property indicator_label1    "Signal UP"
#property indicator_type1    DRAW_ARROW
#property indicator_color1    clrLime
#property indicator_style1    STYLE_SOLID
#property indicator_width1    2

#property indicator_label2    "Signal DN"
#property indicator_type2    DRAW_ARROW
#property indicator_color2    clrRed
#property indicator_style2    STYLE_SOLID
#property indicator_width2    2

double up[];
double dn[];

datetime fin= 0 , last= 0 ;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
  {
     IndicatorSetString ( INDICATOR_SHORTNAME , "Prototype" );
    
   SetIndexBuffer ( 0 ,up, INDICATOR_DATA );
   PlotIndexSetInteger ( 0 , PLOT_ARROW , 233 );
    
   SetIndexBuffer ( 1 ,dn, INDICATOR_DATA );
   PlotIndexSetInteger ( 1 , PLOT_ARROW , 234 );
   
   
  
   return ( INIT_SUCCEEDED );
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate ( const int rates_total,
                 const int prev_calculated,
                 const datetime &time[],
                 const double &open[],
                 const double &high[],
                 const double &low[],
                 const double &close[],
                 const long &tick_volume[],
                 const long &volume[],
                 const int &spread[])
   {
   
   ArraySetAsSeries (open, true );
   ArraySetAsSeries (high, true );
   ArraySetAsSeries (low, true );
   ArraySetAsSeries (close, true );
   ArraySetAsSeries (time, true );   
 
   fin= iTime ( Symbol (), PERIOD_M1 , 0 );
   if (last==fin) return (rates_total);
   last=fin;
   
   if (rates_total - prev_calculated == 1 )
      {
         if (open[ 1 ] > close[ 1 ])
         {
           Print ( "Dn" );
         }
     else if (open[ 1 ] < close[ 1 ])
         {
           Print ( "Up" );
         }
     }

return (rates_total);
}
 
Taras Slobodyanik :

무슨 메시지?
처음부터 나는 prev_calculated와 Rates_total에 대해서만 썼습니다.

귀하로부터 다음과 같은 답변을 받았습니다.

그래서 당신은 거짓말 쟁이입니다)


네, 삭제한 것이 아닙니다. 바로 이 메시지를 찾지 못한 것뿐입니다.

거래, 자동 거래 시스템 및 거래 전략 테스트에 관한 포럼

MQL4 및 MQL5에 대한 초보자 질문, 알고리즘 및 코드에 대한 도움말 및 토론

타라스 슬로보디아닉 , 2021.06.02 16:47

괄호가 없기 때문입니다.

 if (rates_total - prev_calculated == 1 )
   {
   //Print("Новый бар");
   if (open[ 1 ] > close[ 1 ])
        {
         Print ( "Dn" );
        }
   else if (open[ 1 ] < close[ 1 ])
        {
         Print ( "Up" );
        }
   }

하지만! 여전히 당신이 누구인지 말하기를 거부합니다¿
 
그리고 그것이 작동하는 방식입니다
   ArraySetAsSeries (open, true );
   ArraySetAsSeries (high, true );
   ArraySetAsSeries (low, true );
   ArraySetAsSeries (close, true );
   ArraySetAsSeries (time, true );   
 

   if (rates_total - prev_calculated == 1 )
      {
         if (open[ 1 ] > close[ 1 ])
         {
           Print ( "Dn" );
         }
     else if (open[ 1 ] < close[ 1 ])
         {
           Print ( "Up" );
         }
     }
 
도와 주셔서 감사합니다 :)
 
Alexey Viktorov :

네, 삭제한 것이 아닙니다. 바로 이 메시지를 찾지 못한 것뿐입니다.

하지만! 여전히 당신이 누구인지 말하기를 거부합니다¿
알렉세이 빅토로프 :

그렇게 노골적으로 거짓말을 하는 것은 부적절합니다. 당신은 당신의 게시물을 삭제하고 당신의 무지를 다른 사람에게 쏟아 붓고 있습니다. 거짓말 쟁이.

즉, 나는 내 메시지를 삭제 하지 않았고 다른 사람들에게 내 문맹을 비난 하지 않았기 때문에 나는 거짓말 쟁이입니다))))


나는 다시 반복한다

타라스 슬로보디아닉 :

나는 왼쪽 막대의 닫는 것을 읽는 것을 제안하지 않습니다. 이것은 내 코드가 아닙니다)

나만의

 if (rates_total - prev_calculated == 1 )
 
mr LSV :
도와 주셔서 감사합니다 :)

제발)

 
조금만 더 기다려. 조건이있는 경우에만 - 둘 다 GoPro를 사용 - 기록에 대해.
 
Artyom Trishkin :
조금만 더 기다려. 조건이있는 경우에만 - 둘 다 GoPro를 사용 - 기록에 대해.

예, 이것은 일부 "현자"가 과시하는 것과 같은 전략이며 효과가 없을 때 모든 죄를 비난하여 문맹과 무능을 숨기고 상대방이 자신이 바보가 아니라고 정당화하게하십시오.

 
Taras Slobodyanik :

예, 이것은 일부 "현자"가 과시하는 것과 같은 전략이며 효과가 없을 때 모든 죄를 비난하여 문맹과 무능을 숨기고 상대방이 자신이 바보가 아니라고 정당화하게하십시오.

Tarasik, uh on you… 평범함. 힌트를 드린 후 어떤 코드가 나왔는지 보세요... 이것을 '내가 하지 않는 방법을 가르친다'고 하고, 이해하지 못하는 사람은 책임을 져야 합니다.

사유: