초보자의 질문 MQL5 MT5 MetaTrader 5 - 페이지 603

 
Alex :

답변과 인내에 감사드립니다.


블라디미르, 아마도 나는 이미 당신을 고문했을 것입니다 :) 그러나 기본의 기본을 따라 이동하는 것이 매우 어렵습니다. 복사 기능으로 테스트 작업을 하려고 했는데... Printe에 숫자가 있지만 표시기가 그려지지 않습니다... 아무것도 이해하지 못합니다.


동일한 UpBar 배열은 0과 1의 두 버퍼로 이동합니다.

그리고 값을 설정하지 않으려는 인덱스의 경우 빈 값을 작성합니다.

그리고 내가 이해하는 한, 당신은 3에서 Histori 막대까지 값을 씁니다. 이것은 최신 값이 아닌 가장 빠른 값이 기록됨을 의미합니다(번호 매기기 순서는 mql4의 번호 매기기와 다름).

 
Alex :

답변과 인내에 감사드립니다.


블라디미르, 아마도 나는 이미 당신을 고문했을 것입니다 :) 그러나 기본의 기본을 따라 이동하는 것이 매우 어렵습니다. 복사 기능으로 테스트 작업을 하려고 했는데... Printe에 숫자가 있지만 표시기가 그려지지 않습니다... 아무것도 이해하지 못합니다.


 //+------------------------------------------------------------------+
//|                                                        PBars.mq5 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link        ""
#property version    "1.00"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_plots    1
//--- plot UpBar
#property indicator_label1   "UpBar"
#property indicator_type1   DRAW_HISTOGRAM
#property indicator_color1   clrGreen
#property indicator_style1   STYLE_SOLID
#property indicator_width1   6
////--- plot DnBar
//#property indicator_label2  "DnBar"
//#property indicator_type2   DRAW_HISTOGRAM
//#property indicator_color2  clrRed
//#property indicator_style2  STYLE_SOLID
//#property indicator_width2  6
//--- input parameters
input int    Histori= 30 ;
input ENUM_TIMEFRAMES TimeFrame= 0 ;
input string   Simvol= "EURUSD" ;
//--- indicator buffers
double          UpBar[];
//double         DnBar[];
double          O_Price[];
double          C_Price[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
  {
//--- indicator buffers mapping
   SetIndexBuffer ( 0 ,UpBar, INDICATOR_DATA );
//SetIndexBuffer(1,UpBar,INDICATOR_DATA);
   SetIndexBuffer ( 1 ,O_Price, INDICATOR_CALCULATIONS );
   SetIndexBuffer ( 2 ,C_Price, INDICATOR_CALCULATIONS );
//---
   ArraySetAsSeries (O_Price, true );
   ArraySetAsSeries (C_Price, true );
   ArraySetAsSeries (UpBar, true );
   ArrayInitialize (UpBar, 0.0 );
//---
   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 (close, true );

   if (prev_calculated== 0 )
     {
       ArrayInitialize (UpBar, 0.0 );
       ArrayInitialize (O_Price, 0.0 );
       ArrayInitialize (C_Price, 0.0 );
       Print ( __FUNCTION__ );
       ResetLastError ();
       if ( CopyOpen (Simvol,TimeFrame, 0 ,Histori,O_Price)==- 1 )
         Print ( "Error CopyOpen #" , GetLastError ());
       ResetLastError ();
       if ( CopyClose (Simvol,TimeFrame, 0 ,Histori,C_Price)==- 1 )
         Print ( "Error CopyClose #" , GetLastError ());
       for ( int t= 3 ; t<Histori; t++)
        {
         UpBar[t]= MathAbs ( NormalizeDouble ((O_Price[t]-C_Price[t]), Digits ()));
         Print ( IntegerToString (t), " " , DoubleToString (UpBar[t], Digits ()));
         int g= 0 ;
        }
     }
   return (rates_total);
  }
//+------------------------------------------------------------------+

결과:

결과

 
Karputov Vladimir :

결과:


다시 한 번 진심으로 감사드립니다.
 
Alex :
다시 한번 감사합니다.
물론이죠. MQL5에 대한 질문이 있으면 문의하십시오.
 

MQL4에 지정된 바 수에 대해 최대/최소 가격 값을 반환하는 함수가 있는지 알려주실 수 있습니까?

하나 있었던거 같은데 못찾겠어요...

 
-Aleks- :

MQL4에 지정된 바 수에 대해 최대/최소 가격 값을 반환하는 함수가 있는지 알려주실 수 있습니까?

하나 있었던거 같은데 못찾겠어요...

https://docs.mql4.com/ru/series/ihighest

https://docs.mql4.com/ru/series/ilowest

iHighest - Доступ к таймсериям и индикаторам - Справочник MQL4
iHighest - Доступ к таймсериям и индикаторам - Справочник MQL4
  • docs.mql4.com
iHighest - Доступ к таймсериям и индикаторам - Справочник MQL4
 
예, 감사합니다. 제가 잘못 찾고 있었습니다. 이미 제가 직접 찾았습니다.
 
-Aleks- :
예, 감사합니다. 제가 잘못 찾고 있었습니다. 이미 제가 직접 찾았습니다.
결과 어레이 ArrayMaximumArrayMinimum 에서 mql5 CopyHighCopyLow 와 호환되는 기능
 
거래 시스템을 구성하는 각 변수 집합이 이익과 손실의 무작위 분포를 특징으로 한다는 것이 사실입니까?
 
Евгений :
거래 시스템을 구성하는 각 변수 집합이 이익과 손실의 무작위 분포를 특징으로 한다는 것이 사실입니까?

반론.

차트, 입찰 및 매도호가 등 모든 통화 쌍의 움직임은 변수 집합에 따라 달라집니다.

사유: