오류, 버그, 질문 - 페이지 2613

 
Vladimir Pastushak :

GetMicrosecondCount()에 대한 질문

그리고 비디오가 끝나면 인쇄 로그가 표시됩니다.

외경 0 22:58:46.604 테스트(EURUSD,M15) 66190

지제이 0 22:58: 46.669 테스트(EURUSD,M15) 65134

지큐 0 22:58: 55.914 테스트(EURUSD,M15) 67867 이 값과 이전 값의 차이는 9초이지만 GetMicrosecondCount() 는 67867마이크로초/초를 표시합니다.

PD 0 22:58:56.715 테스트(EURUSD,M15) 66139

 
Vladimir Pastushak :

그리고 비디오가 끝나면 인쇄 로그가 표시됩니다.

외경 0 22:58:46.604 테스트(EURUSD,M15) 66190

지제이 0 22:58: 46.669 테스트(EURUSD,M15) 65134

지큐 0 22:58: 55.914 테스트(EURUSD,M15) 67867 이 값과 이전 값의 차이는 9초이지만 GetMicrosecondCount()는 67867마이크로초/초를 표시합니다.

PD 0 22:58:56.715 테스트(EURUSD,M15) 66139

overflow.. 카운터는 모듈로 비교해야 합니다.

 
Vladimir Pastushak :

그리고 비디오가 끝나면 인쇄 로그가 표시됩니다.

외경 0 22:58:46.604 테스트(EURUSD,M15) 66190

지제이 0 22:58: 46.669 테스트(EURUSD,M15) 65134

지큐 0 22:58: 55.914 테스트(EURUSD,M15) 67867 이 값과 이전 값의 차이는 9초이지만 GetMicrosecondCount()는 67867마이크로초/초를 표시합니다.

PD 0 22:58:56.715 테스트(EURUSD,M15) 66139

불행히도 당신은 완전한 코드를 보여주지 않았습니다.

코드를 완전히 무시하고 비디오만 제시하고 100만분의 1초 측정을 어떻게 논의할 것인가?


마이크로초 타이머 측정의 정확성에 대해 논의하고 싶다면 다음 예제를 실행하십시오.

 void OnStart ()
  {
   ulong ticks;
//---
   ticks= GetMicrosecondCount ();   
   Sleep ( 40 );
   Print ( "40 ms = " , GetMicrosecondCount ()-ticks, " msc" );
//---   
   ticks= GetMicrosecondCount ();   
   Sleep ( 10 );
   Print ( "10 ms = " , GetMicrosecondCount ()-ticks, " msc" );
  }

40 ms = 40354 msc
10 ms = 10487 msc

측정오차가 없습니다.

GetMicrosecondCount()는 QueryPerformanceCounter 시스템 카운터에서 작동하며 편의를 위해 응용 프로그램 시작 시간에 대한 참조가 제공됩니다.

타이밍 코드에서 오류를 찾으십시오.

 
MetaQuotes Software Corp. :

불행히도 당신은 완전한 코드를 보여주지 않았습니다.

코드를 완전히 무시하고 비디오만 제시하고 100만분의 1초 측정을 어떻게 논의할 것인가?


마이크로초 타이머 측정의 정확성에 대해 논의하고 싶다면 다음 예제를 실행하십시오.

측정오차가 없습니다.

GetMicrosecondCount()는 QueryPerformanceCounter 시스템 카운터에서 작동하며 편의를 위해 응용 프로그램 시작 시간에 대한 참조가 제공됩니다.

타이밍 코드에서 오류를 찾으십시오.

나는 표준 라이브러리를 사용했다 . 잠시 후에 코드를 버릴 것이지만 거기에는 새로운 것이 없습니다.

 

통화 및 국가 선택을 저장하는 것은 나쁘지 않습니다.

 
마지막 업데이트 후 테스터는 시각적 테스트 모드에서 지연되고 30-60초 동안 정지되고 차트를 스크롤하여 기록의 시작 부분으로 이동합니다. 개체 생성에 버그가 있습니다. 예를 들어 버튼을 만들고 위치가 전경에 있고 선을 만들고 위치가 배경에 있지만 버튼을 누르려고 할 때 개체가 교차하면 버튼은 시각적으로 처음에 있지만 선은 전경에 있습니다. 버튼을 마우스로 누르고 있으면 생성된 라인의 이름이 있는 팝업 메뉴(버튼을 기준으로 배경에 있음)가 표시됩니다.
 

순방향 최적화 가 완료되기 전에 결과를 볼 수 있기를 바랍니다.

이 결과가 기본 최적화 결과와 동일한 방식으로 창에 표시되기를 바랍니다. 그리고 지금이 창은 전혀 존재하지 않습니다!

이상합니다 - 왜 하나의 창이 있고 다른 하나는 동일한 (본질적으로) 프로세스에 있지 않습니다 ...

 

내가 이해하는 한 "시장 감시" 창에서 기호의 입찰가와 매도호가가 이제 비활성화되지 않습니까?

빌드 2265.

 
//+------------------------------------------------------------------+
//|                                                         Test.mq5 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link        "https://www.mql5.com"
#property version    "1.00"
#property indicator_chart_window
#property indicator_plots    1
#property indicator_buffers 1
#include <Trident\TCoreMain.mqh>
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
  {
   :: EventSetMillisecondTimer ( 500 );
   return ( INIT_SUCCEEDED );
  }
  
   void OnDeinit ( const int reason) {
   :: EventKillTimer ();
}

void OnTimer () {
   :: EventKillTimer ();
   TestPhoto();
}
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   
//--- return value of prev_calculated for next call
   return (rates_total);
  }
//+------------------------------------------------------------------+

void TestPhoto() {
   string name;
   MqlDateTime   dtLocal;
   TimeToStruct ( TimeLocal (), dtLocal);
   string date = IntegerToString (dtLocal.year) + IntegerToString (dtLocal.mon, 2 , '0' ) + IntegerToString (dtLocal.day, 2 , '0' );
   string time = IntegerToString (dtLocal.hour, 2 , '0' ) + "." + IntegerToString (dtLocal.min, 2 , '0' ) + "." + IntegerToString (dtLocal.sec, 2 , '0' );
   name = "ScreenShots/" + date + "/" + _Symbol + "_" +date + "_" + time + ".png" ;
   
   if (! ChartScreenShot ( 0 , name, 1920 , 1200 , ALIGN_RIGHT ))
       return ;

   ResetLastError ();
   
   for ( int i= 0 ; i < 100000 ; i++){
       if ( FileIsExist (name, false ) && FileSize (name) > 0 )
         break ;
   }
   //---
   int flags= FILE_READ | FILE_BIN | FILE_SHARE_READ ;

   //---
   int file= FileOpen (name,flags);
   if (file< 0 ) {
       Print ( "Операция FileOpen неудачна, ошибка " , GetLastError ());
       return ;
}
   uchar photo[];
   FileReadArray (file,photo);
   FileClose (file);
   
   Print ( ArraySize (photo));
}

표시기에서 바이너리 파일 읽기가 작동하지 않습니다!!! 어드바이저의 유사한 코드는 문제 없이 작동합니다.

 
//+------------------------------------------------------------------+
//|                                                         Test.mq5 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link        "https://www.mql5.com"
#property version    "1.00"
#property indicator_chart_window
#property indicator_plots    1
#property indicator_buffers 1
#include <Trident\TCoreMain.mqh>
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
  {
   :: EventSetMillisecondTimer ( 500 );
   return ( INIT_SUCCEEDED );
  }
  
   void OnDeinit ( const int reason) {
   :: EventKillTimer ();
}

void OnTimer () {
   :: EventKillTimer ();
   TestPhoto();
}
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   
//--- return value of prev_calculated for next call
   return (rates_total);
  }
//+------------------------------------------------------------------+

void TestPhoto() {
   string name;
   MqlDateTime   dtLocal;
   TimeToStruct ( TimeLocal (), dtLocal);
   string date = IntegerToString (dtLocal.year) + IntegerToString (dtLocal.mon, 2 , '0' ) + IntegerToString (dtLocal.day, 2 , '0' );
   string time = IntegerToString (dtLocal.hour, 2 , '0' ) + "." + IntegerToString (dtLocal.min, 2 , '0' ) + "." + IntegerToString (dtLocal.sec, 2 , '0' );
   name = "ScreenShots/" + date + "/" + _Symbol + "_" +date + "_" + time + ".png" ;
   
   if (! ChartScreenShot ( 0 , name, 1920 , 1200 , ALIGN_RIGHT ))
       return ;

   ResetLastError ();
   
   for ( int i= 0 ; i < 100000 ; i++){
       if ( FileIsExist (name, false ) && FileSize (name) > 0 )
         break ;
   }
   //---
   int flags= FILE_READ | FILE_BIN | FILE_SHARE_READ ;

   //---
   int file= FileOpen (name,flags);
   if (file< 0 ) {
       Print ( "Операция FileOpen неудачна, ошибка " , GetLastError ());
       return ;
}
   uchar photo[];
   FileReadArray (file,photo);
   FileClose (file);
   
   Print ( ArraySize (photo));
}
표시기에서 이진 파일을 읽는 것은 작동하지 않으며 고문의 유사한 코드는 문제 없이 작동합니다!