장점 정리???? - 페이지 8

 
Алексей Тарабанов # :
그리고 손녀를 위한 작업도 설정했습니다. Z는 Y에 종속되고 Y는 X에 종속됩니다. X에 Z의 종속성에 대한 그래프를 그립니다. 그래픽으로. 무승부.

감사합니다 이해합니다

 
prostotrader # :

일반적으로 500개의 레코드를 살펴보았는데 원본 이 없으면 100% 확신할 수 없습니다.

그러나 누락된 따옴표가 있으면 MT5에서도 가능합니다(그러나 훨씬 적음).

여러분의 시간을 '소화가능'으로 번역하여 MT5에서 BID와 ASK를 따로 추출해 보도록 하겠습니다,

그러나 그럼에도 불구하고 너무 많은 불일치가 있다는 것은 분명합니다!

예, 불일치가 있습니다. 거래소에서 전송한 공통 테이블과 집계된 주문서는 100% 신뢰할 수 없습니다. 이것은 거래소 자체에 의해 명시되어 있습니다.
거래소에 따르면 100% 신뢰할 수 있는 데이터는 orders_log 테이블에만 있지만 구독하는 데 약간의 비용이 듭니다.
MT5가 어떤 스트림과 테이블에서 데이터를 가져오고 어떻게 가져오는지 100% 말할 수는 없고 추측만 할 수 있습니다.
따라서 데이터가 어디서 어떻게 왔는지 알기 때문에 내 자신의 목적을 위해 자체 소프트웨어를 사용합니다.
결과는 지금까지 나에게 만족스럽습니다.

 
Vladimir Mikhailov # :

예, 불일치가 있습니다. 거래소에서 전송한 공통 테이블과 집계된 주문서는 100% 신뢰할 수 없습니다. 이것은 거래소 자체에 의해 명시되어 있습니다.
거래소에 따르면 100% 신뢰할 수 있는 데이터는 orders_log 테이블에만 있지만 구독하는 데 약간의 비용이 듭니다.
MT5가 어떤 스트림과 테이블에서 데이터를 가져오고 어떻게 가져오는지 100% 말할 수는 없고 추측만 할 수 있습니다.
따라서 데이터가 어디서 어떻게 왔는지 알기 때문에 내 자신의 목적을 위해 자체 소프트웨어를 사용합니다.
결과는 지금까지 나에게 만족스럽습니다.

MT-5는 당신과 같은 장소에서 데이터를 가져옵니다. PlazaII

나는 당신의 시간을 변환했습니다 시간의 불일치가 많이 있습니다 따옴표는 동일 시간이 다릅니다

빨간색은 누락된 따옴표를 표시합니다.

시간 변환기

 //+------------------------------------------------------------------+
//|                                                    Convertor.mq5 |
//|                                     Copyright 2021, prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, prostotrader"
#property link        " https://www.mql5.com "
#property version    "1.00"
#define STR_POS 8
ulong base_time_ns;
ulong add_time; //добивка до Московского времи

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
string GetTime( const string b_str)
{
   ulong cur_time = ulong ( StringToInteger (b_str));
   if (cur_time > 0 )
  {
     ulong full_time = (cur_time + add_time);
     ulong diff_time = full_time - base_time_ns;
     if (diff_time > 0 )
    {
       ulong sec_time = ulong ( double (full_time)/ 1000000000 );
       ulong ms_time = ulong ( double ((full_time - sec_time* 1000000000 ))/ 1000000 ); 
       ulong mcs_time = ulong ( double ( full_time - (sec_time* 1000000000 + ms_time* 1000000 ))/ 1000 );
       ulong ns_time = full_time - (sec_time* 1000000000 + ms_time* 1000000 + mcs_time* 1000 );
       return ( TimeToString ( datetime (sec_time), TIME_SECONDS ) + "." + StringFormat ( "%03i" , ms_time) +
             "." + StringFormat ( "%03i" , mcs_time) + "." + StringFormat ( "%03i" , ns_time));
    }
     else return ( "Time out of range!" ); 
  }
   return ( "" );
}
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
bool GetParams( const string a_str, string &a_1, string &a_2, string &a_3,
                     string &a_4, string &a_5, string &a_6, string &a_7,
                     string &a_8, string &a_9)
{
   if (base_time_ns > 0 )
  {
     string tmp_str = a_str;
     int cnt = 0 ;
     while (cnt<STR_POS)
    {
       int a_pos = StringFind (tmp_str, ";" );
       if (a_pos > 0 )
      {
         switch (cnt)
        {
           case 0 :
            a_1 = StringSubstr (tmp_str, 0 , a_pos);
           break ;
           case 1 :
            a_2 = StringSubstr (tmp_str, 0 , a_pos);
           break ;
           case 2 :
            a_3 = StringSubstr (tmp_str, 0 , a_pos);
           break ;
           case 3 :
            a_4 = StringSubstr (tmp_str, 0 , a_pos);
           break ;
           case 4 :
            a_5 = StringSubstr (tmp_str, 0 , a_pos);
           break ;
           case 5 :
            a_6 = StringSubstr (tmp_str, 0 , a_pos);
           break ;
           case 6 :
            a_7 = StringSubstr (tmp_str, 0 , a_pos);
           break ;
           case 7 :
            a_8 = GetTime( StringSubstr (tmp_str, 0 , a_pos));
            a_9 = GetTime( StringSubstr (tmp_str, a_pos + 1 ));
           break ;
        }
      }
      tmp_str = StringSubstr (tmp_str, a_pos + 1 );
      cnt++;
    }
     return ( true );
  }
   return ( false );
}
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit ()
{
   int str_cnt = 0 ;
  base_time_ns = ulong ( D'20.10.2021 07:00:00' ) * 1000 * 1000 * 1000 ;
  add_time = ( 3 * 3600 );
  add_time = add_time* 1000000000 ;
   string in_str, par_1, par_2, par_3, par_4, par_5, par_6, par_7, par_8, par_9;
   int in_handle= FileOpen ( "gazp-20-10-2021.csv" , FILE_READ | FILE_ANSI | FILE_CSV ); 
   if (in_handle!= INVALID_HANDLE )
  {
     int out_handle= FileOpen ( "gazp-20-10-2021_new.csv" , FILE_WRITE | FILE_CSV ); 
     if (out_handle!= INVALID_HANDLE )
    {
       while (! FileIsEnding (in_handle))
      {
         if (str_cnt == 0 )
        {
          in_str = FileReadString (in_handle);
           FileWrite (out_handle, "id" , "best_buy" , "xamount_buy" , "best_sell" , "xamount_sell" , "price" , "xamount" , "deal_time_ns" , "mod_time_ns" );
        }
         else
        {
          in_str = FileReadString (in_handle);
           if ( StringLen (in_str) > 0 )
          {
             if (GetParams(in_str, par_1, par_2, par_3, par_4, par_5, par_6, par_7, par_8, par_9) == true )
               FileWrite (out_handle, par_1, par_2, par_3, par_4, par_5, par_6, par_7, par_8, par_9);
          }
        }
        str_cnt++;
      } 
       FileClose (out_handle);
    }
     FileClose (in_handle);
  }   
//---
   return ( INIT_SUCCEEDED );
}
//+------------------------------------------------------------------+

파일을 더 이상 보지 않았습니다.

파일:
 

블라디미르!

물론 한 번의 실패가 있을 수 있지만 누락된 따옴표 가 많이 있고 MT-5는 시간에 문제가 있습니다.

(내가 이해하는 한 아무 것도하지 않고 테이블에서 시간을 복사하기 만하면됩니다),

인상은 그들 스스로가 그것을 (시간) "이끈다"는 것입니다.

코드 확인(공백 없음)

여기서 "0"을 사용하고 있습니까?

result = cg_conn_process(conn, 0 , NULL );
파일:
 
prostotrader # :

블라디미르!

물론 한 번의 실패가 있을 수 있지만 누락된 따옴표 가 많이 있고 MT-5는 시간에 문제가 있습니다.

(내가 이해하는 한 아무 것도하지 않고 테이블에서 시간을 복사하기 만하면됩니다),

인상은 그들 스스로가 그것을 (시간) "이끈다"는 것입니다.

코드 확인(공백 없음)

여기서 "0"을 사용하고 있습니까?

예, 시간은 테이블에서 가져옵니다.
conn_process는 0을 사용합니다.

패스가 없습니다.

다음은 콜백 함수 코드입니다.

CG_RESULT MessageCallbackQuote(cg_conn_t* conn, cg_listener_t* listener, struct cg_msg_t* msg, void * data)
{
         static size_t offset_isin_id = 0 ;
         static size_t offset_best_buy = 0 ;
         static size_t offset_xamount_buy = 0 ; //i8
         static size_t offset_best_sell = 0 ;
         static size_t offset_xamount_sell = 0 ; //i8
         static size_t offset_price = 0 ; //d16.5
         static size_t offset_xamount = 0 ; //i8
         static size_t offset_deal_time_ns = 0 ; //u8
         static size_t offset_replAct = 0 ; //i8
         static size_t offset_mod_time_ns = 0 ; //u8

         switch (msg->type)
        {
         case CG_MSG_STREAM_DATA:
        {
                int64_t price_int = 0 ;
                int8_t price_scale = 0 ;
                 long long xamount_buy = 0 ;
                 long long xamount_sell = 0 ;
                 double price;
                 long long xamount = 0 ;
                 unsigned long long deal_time_ns = 0 ;
                 unsigned long long mod_time_ns = 0 ;
                 double best_buy = 0 ;
                 double best_sell = 0 ;

                cg_msg_streamdata_t* replmsg = (cg_msg_streamdata_t*)msg;
                 char * data = ( char *)replmsg->data;
                 if (*(int64_t*)(data + offset_replAct) == 0 && fut_isin_id == *((int32_t*)(data + offset_isin_id)))
                {
                        cg_bcd_get((( char *)(data + offset_best_buy)), &price_int, &price_scale);
                        best_buy = (( double )price_int) / ( pow ( 10.0 , price_scale));

                        cg_bcd_get((( char *)(data + offset_best_sell)), &price_int, &price_scale);
                        best_sell = (( double )price_int) / ( pow ( 10.0 , price_scale));

                        cg_bcd_get((( char *)(data + offset_price)), &price_int, &price_scale);
                        price = (( double )price_int) / ( pow ( 10.0 , price_scale));

                        xamount_buy = *((int64_t*)(data + offset_xamount_buy));
                        xamount_sell = *((int64_t*)(data + offset_xamount_sell));
                        xamount = *((int64_t*)(data + offset_xamount));

                        mod_time_ns = *((uint64_t*)(data + offset_mod_time_ns));
                        deal_time_ns = *((uint64_t*)(data + offset_deal_time_ns));

                        size_t s = quote.size();
                         if (s == 0 )
                        {
                                quote.push_back(SQuote(best_buy, xamount_buy, best_sell, xamount_sell, price, xamount, deal_time_ns, mod_time_ns));
                        }
                         else
                        {
                                 if (quote[s - 1 ].best_buy != fut_bid || quote[s - 1 ].best_sell != fut_ask ||
                                        quote[s - 1 ].xamount_buy != xamount_buy || quote[s - 1 ].xamount_sell != xamount_sell ||
                                        quote[s - 1 ].price != price || quote[s - 1 ].xamount != xamount ||
                                        quote[s - 1 ].deal_time_ns != deal_time_ns)
                                {
                                        quote.push_back(SQuote(best_buy, xamount_buy, best_sell, xamount_sell, price, xamount, deal_time_ns, mod_time_ns));
                                }
                        }
                        
                         return ( 0 );
                }
        }
         break ;
         case CG_MSG_OPEN:
        {
                 struct cg_scheme_desc_t* schemedesc = 0 ;
                cg_lsn_getscheme(listener, &schemedesc);

                size_t msgidx = 0 ;
                 for (cg_message_desc_t* msgdesc = schemedesc->messages; msgdesc; msgdesc = msgdesc->next, msgidx++)
                {
                        size_t fieldindex = 0 ;
                         if (strcmp(msgdesc->name, "common" ) == 0 )
                        {
                                 for (cg_field_desc_t* fielddesc = msgdesc->fields; fielddesc; fielddesc = fielddesc->next, fieldindex++)
                                {
                                         if (strcmp(fielddesc->name, "replAct" ) == 0 && strcmp(fielddesc->type, "i8" ) == 0 )
                                        {
                                                offset_replAct = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "isin_id" ) == 0 && strcmp(fielddesc->type, "i4" ) == 0 )
                                        {
                                                offset_isin_id = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "best_buy" ) == 0 && strcmp(fielddesc->type, "d16.5" ) == 0 )
                                        {
                                                offset_best_buy = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "best_sell" ) == 0 && strcmp(fielddesc->type, "d16.5" ) == 0 )
                                        {
                                                offset_best_sell = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "mod_time_ns" ) == 0 && strcmp(fielddesc->type, "u8" ) == 0 )
                                        {
                                                offset_mod_time_ns = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "deal_time_ns" ) == 0 && strcmp(fielddesc->type, "u8" ) == 0 )
                                        {
                                                offset_deal_time_ns = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "price" ) == 0 && strcmp(fielddesc->type, "d16.5" ) == 0 )
                                        {
                                                offset_price = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "xamount_buy" ) == 0 && strcmp(fielddesc->type, "i8" ) == 0 )
                                        {
                                                offset_xamount_buy = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "xamount_sell" ) == 0 && strcmp(fielddesc->type, "i8" ) == 0 )
                                        {
                                                offset_xamount_sell = fielddesc->offset;
                                        }
                                         else if (strcmp(fielddesc->name, "xamount" ) == 0 && strcmp(fielddesc->type, "i8" ) == 0 )
                                        {
                                                offset_xamount = fielddesc->offset;
                                        }
                                }
                        }
                }
        }
         break ;
         case CG_MSG_P2REPL_ONLINE:
        {
                 printf ( "%s: Futures qoute online!\n" , cserver_time);
                fut_is_ready = true ;
        }
         break ;
         case CG_MSG_CLOSE:
        {
                 printf ( "%s: Futures qoute offline!\n" , cserver_time);
                fut_is_ready = false ;
        }
         break ;
        }
         return 0 ;
};
 
Vladimir Mikhailov # :

패스가 없습니다.


해명해주세요....

 
prostotrader # :

해명해주세요....

이 구성은 변경 사항이 있는 모든 항목이 저장됨을 의미합니다.

size_t s = quote.size();
if (s == 0 )
{
        quote.push_back(SQuote(best_buy, xamount_buy, best_sell, xamount_sell, price, xamount, deal_time_ns, mod_time_ns));
}
else
{
         if (quote[s - 1 ].best_buy != fut_bid || quote[s - 1 ].best_sell != fut_ask ||
                quote[s - 1 ].xamount_buy != xamount_buy || quote[s - 1 ].xamount_sell != xamount_sell ||
                quote[s - 1 ].price != price || quote[s - 1 ].xamount != xamount ||
                quote[s - 1 ].deal_time_ns != deal_time_ns)
        {
                quote.push_back(SQuote(best_buy, xamount_buy, best_sell, xamount_sell, price, xamount, deal_time_ns, mod_time_ns));
        }
}
 
Vladimir Mikhailov # :

이 구성은 변경 사항이 있는 모든 항목이 저장됨을 의미합니다.

나는 코드를 의미하는 것이 아니라 MT5에 인용문이 있음을 보여주는 비교표를 의미하지만 당신은 그렇지 않습니다.

 
prostotrader # :

나는 코드를 의미하는 것이 아니라 MT5에 인용문이 있음을 보여주는 비교표를 의미하지만 당신은 그렇지 않습니다.

대부분의 MT5 데이터는 orders_log 또는 FAST에서 가져옵니다.

 
Vladimir Mikhailov # :

이 구성은 변경 사항이 있는 모든 항목이 저장됨을 의미합니다.

어디에서 호출됩니까? 전문가로부터? 전문가의 경우 공백이 있습니다.