FORTS 도와주세요 - 페이지 4

 
alexvd :
서비스 데스크에서 소스를 받았습니다. Test() 함수에 마지막 코드를 넣어보십시오.
디마_S :
마이클, 나는 당신의 완고함을 이해하지 못합니다. 또는 복사/붙여넣기 문제)) 내 코드를 사용해 보세요.
그의 레퍼토리에서 Mikalas. 축치는 독자가 아니라 축치는 작가)
 
Dima_S :
마이클, 나는 당신의 완고함을 이해하지 못합니다. 또는 복사/붙여넣기 문제)) 내 코드를 사용해 보세요.
 2015.03 . 26 18 : 12 : 41.068 Test_dima (MIX- 6.15 ,M1) Get Bars failed RTS- 6.15 Last error = 4401
2015.03 . 26 18 : 12 : 41.068 Test_dima (MIX- 6.15 ,M1) Get Bars failed RTS- 6.15 Last error = 4401
2015.03 . 26 18 : 12 : 41.068 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 41.698 Test_dima (MIX- 6.15 ,M1) Get Bars failed Si- 6.15 Last error = 4401
2015.03 . 26 18 : 12 : 41.698 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 41.858 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 41.858 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 41.978 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 41.978 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 43.230 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 43.230 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 45.134 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 45.134 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 46.244 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 46.244 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 46.314 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 46.314 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 46.314 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 46.314 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 46.314 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 46.314 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 46.324 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 46.324 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 46.334 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 46.334 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 46.664 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 46.664 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 47.704 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 47.704 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 47.834 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 47.834 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 47.854 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 47.854 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 47.974 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 47.974 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.014 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.014 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.044 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.044 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.304 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.304 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.324 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.324 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.344 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.344 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.364 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.364 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.394 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.394 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.404 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.404 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.474 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.474 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.494 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.494 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.514 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.514 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.524 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.524 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.564 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.564 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.594 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.594 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.614 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.614 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.634 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.634 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.654 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.654 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.674 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.674 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.724 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.724 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.754 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.754 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.774 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.774 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.794 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.794 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.814 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.814 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 49.854 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 49.854 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.374 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.374 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.484 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.484 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.504 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.504 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.524 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.524 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.554 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.554 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.574 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.574 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.604 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.604 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.634 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.634 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.664 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.664 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.684 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.684 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.764 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.764 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.784 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.784 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.824 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.824 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.834 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.834 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.854 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.854 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.874 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.874 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.884 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.884 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.934 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.934 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.954 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.954 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.974 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.974 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 50.994 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 50.994 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 51.004 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 51.004 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 51.034 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 51.034 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 51.064 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 51.064 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 51.094 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 51.094 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 51.104 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 51.104 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
2015.03 . 26 18 : 12 : 51.134 Test_dima (MIX- 6.15 ,M1) Init OK.
2015.03 . 26 18 : 12 : 51.134 Test_dima (MIX- 6.15 ,M1) Sorry! Get Bars failed.
 
Mikalas :

그렇게 될 수 없습니다. 일종의 시스템 오류가 있습니다. 내 말은, 터미널에서))

먼저 디스크에서 이력 데이터를 삭제하고 터미널을 다시 시작하십시오.

 
Dima_S :

그렇게 될 수 없습니다. 일종의 시스템 오류가 있습니다. 내 말은, 터미널에서))

먼저 디스크에서 이력 데이터를 삭제하고 터미널을 다시 시작하십시오.

코드에서 ResetLastError () 직후 is_failed 전역 변수 의 오류를 재설정해야 합니다. 그렇지 않으면 오류를 포착하면 이에 대한 메시지를 받게 됩니다.
 
Dima_S :

그렇게 될 수 없습니다. 일종의 시스템 오류가 있습니다. 내 말은, 터미널에서))

먼저 디스크에서 이력 데이터를 삭제하고 터미널을 다시 시작하십시오.

"안 돼"은(는) 무슨 뜻인가요?

내가 로그를 조작하고 있다는 의미입니까?

 
komposter :
그의 레퍼토리에서 Mikalas. 축치는 독자가 아니라 축치는 작가)

퇴비!

당신이 뭔가를 이해하지 못하거나 실수하면 아무도 당신을 축치라고 부르지 않습니다.

왜 그래?

 

평화롭게 살자 :)

alexvd :
코드에서 ResetLastError () 직후 is_failed 전역 변수 의 오류를 재설정해야 합니다. 그렇지 않으면 오류를 포착하면 이에 대한 메시지를 받게 됩니다.

한 번에가 아니라 성공적으로 로드할 때만 가능합니다.

 #property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link        "http://www.mql5.com"
#property version    "1.00"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_plots    1
//
bool is_failed = false ;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit ()
  {
//--- indicator buffers mapping
   SymbolSelect ( "MIX-6.15" , true );
   SymbolSelect ( "RTS-6.15" , true );
   SymbolSelect ( "Si-6.15" , true );
//---  
   ResetLastError ();
//---  
   int total_bars = Bars ( "MIX-6.15" , PERIOD_M1 );
   if ( total_bars > 0 )
  {
    total_bars = Bars ( "RTS-6.15" , PERIOD_M1 );
     if ( total_bars > 0 )
    {
      total_bars = Bars ( "Si-6.15" , PERIOD_M1 );
      {
         if ( total_bars > 0 )
        {
           Print ( "Init OK." );
        }
         else
        {
          is_failed = true ;
           Print ( "Get Bars failed Si-6.15 Last error = " , string ( GetLastError () ) );
        }
      }
    }
     else
    {
      is_failed = true ;
       Print ( "Get Bars failed RTS-6.15 Last error = " , string ( GetLastError () ) );
    }
  }
   else
  {
    is_failed = true ;
     Print ( "Get Bars failed MIX-6.15 Last error = " , string ( GetLastError () ) );
  } 
//---
   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[])
  {
   ResetLastError ();
//---  
   int total_bars = Bars ( "MIX-6.15" , PERIOD_M1 );
   if ( total_bars > 0 )
  {
    total_bars = Bars ( "RTS-6.15" , PERIOD_M1 );
     if ( total_bars > 0 )
    {
      total_bars = Bars ( "Si-6.15" , PERIOD_M1 );
      {
         if ( total_bars > 0 )
        {
          is_failed = false ;
           Print ( "Init OK." );
        }
         else
        {
          is_failed = true ;
           Print ( "Get Bars failed Si-6.15 Last error = " , string ( GetLastError () ) );
        }
      }
    }
     else
    {
      is_failed = true ;
       Print ( "Get Bars failed RTS-6.15 Last error = " , string ( GetLastError () ) );
    }
  }
   else
  {
    is_failed = true ;
     Print ( "Get Bars failed MIX-6.15 Last error = " , string ( GetLastError () ) );
  } 
//---
   if ( is_failed )
   {
     Print ( "Sorry! Get Bars failed." );
   }
   else Print ( "Bingo! We done." );
//--- return value of prev_calculated for next call
   return (rates_total);
  }
 
MigVRN :

평화롭게 살자 :)

한 번에가 아니라 성공적으로 로드할 때만 가능합니다.

그렇게 될 수 있습니다. 필수는 아닙니다.

 
alexvd :

그렇게 될 수 있습니다. 필수는 아닙니다.

그리고 음, 예 ... 바로 가능하다는 것이 밝혀졌습니다.

미칼라스 :

최신 로그로 판단하면 함수에서 오류를 3번 반환합니다. 초기화 중에 2번 OnCalculate() 에서 1번. 포함 모든 것이 작동했습니다 :)

 
MigVRN :

그리고 음, 예 ... 바로 가능하다는 것이 밝혀졌습니다.

최신 로그로 판단하면 함수에서 오류가 3번 반환됩니다. 초기화 중에 2번, OnCalculate()에서 1번. 포함 모든 것이 작동했습니다 :)

예, 하지만 실제로 데이터가 없는 경우에는 어떻게 합니까?

그럼? 주기? 얼마나 많은 반복으로?