포럼을 어지럽히 지 않도록 모든 초보자 질문. 프로, 놓치지 마세요. 너 없이는 아무데도 - 6. - 페이지 732

 
Fox_RM :

모두들 안녕!

Expert Advisor에서 iCustom 을 통해 값을 전달할 때 어떤 문제가 있는지 알려주세요.

2014.10.12 10:23:06.656 TestGenerator: 일치하지 않는 데이터 오류(2014.03.14 21:45에서 볼륨 제한 470 초과)

2014.10.12 10:23:53.468 2014.03.06 18:15 ClusterExp2 GBPUSD,M15: 2147483647 2147483647

클립의 Correl8 표시기.

미리 감사합니다!

테스트 중인 기호에 대한 기록을 업로드합니다. iCustom()이 아닌 기록 데이터의 오류
 
artmedia70 :
테스트 중인 기호에 대한 기록을 업로드합니다. iCustom()이 아닌 기록 데이터의 오류
감사해요!!!
 
borilunad :
좋은 아침입니다, Artyom! 예, 마술사에 대해서는 분명합니다! 그러나 무언가가 루프에 있지 않고 if-else와 같은 조건에서 이전에 mySymbol= Symbol 을 제시한 if(Symbol()==mySymbol)(물론, else 없이) 첫 번째 조건만 넣으면 충분합니다. ()?! 모든 전문가의 모든 변수는 동일하지만 각각 자체 차트에 있습니다! 아직 확인이 안 되어서 계속 '갈취'를 하고 있어요! :)
문자열 mySymbol=Symbol();인 경우 이 변수는 현재 기호의 값을 포함합니다. 따라서 자체 차트에서 거래되는 각 Expert Advisor의 경우 이 변수의 값은 Expert Advisor가 시작되는 기호의 값과 동일합니다.
 
artmedia70 :
문자열 mySymbol=Symbol();인 경우 이 변수는 현재 기호의 값을 포함합니다. 따라서 자체 차트에서 거래되는 각 Expert Advisor의 경우 이 변수의 값은 Expert Advisor가 시작되는 기호의 값과 동일합니다.
왠지 string'에 대해 생각하지 않았습니다! 다른 Expert Advisors에서 잘 작동하는 입증된 기능에서 나오는 오류를 만지작거리고 있는 동안! 매우 감사합니다!
 

파일로 인쇄합니다. 나는 이 파일에 타이핑하는 법을 배우고 있다.

cl_time에서 0을 인쇄하는 이유는 무엇입니까?

1.37243 1.37253 -하나 07:27:13 00:00:00
1.37248 1.37256 -하나 07:57:21 00:00:00
1.37256 1.37256 -하나 08:17:30 00:00:00
1.37266 1.37268 -하나 08:48:11 00:00:00
1.37267 1.37293 -하나 08:53:15 00:00:00
1.37269 1.37307 하나 09:17:57 00:00:00
1.37275 1.3727 하나 10:23:02 00:00:00
1.37269 1.37269 하나 10:28:03 00:00:00
1.37268 1.37231 하나 10:33:10 00:00:00
1.37278 1.37255 하나 10:57:38 00:00:00
1.37256 1.37269 -하나 11:02:42 00:00:00
1.37268 1.37284 하나 11:07:45 00:00:00
1.37283 1.37307 -하나 11:12:49 00:00:00
1.37314 1.37335 하나 12:11:37 00:00:00
1.37317 1.37323 하나 12:23:12 00:00:00
1.37324 1.37326 하나 12:28:20 00:00:00
1.37396 1.37415 하나 13:26:32 00:00:00
1.37413 1.37419 하나 13:37:20 00:00:00
1.3744 1.37578 하나 13:56:29 00:00:00

 //+------------------------------------------------------------------+
//|                                                    cci on ma.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+

#property copyright    "2005-2014, MetaQuotes Software Corp."
#property link          "https://www.mql4.com"
#property strict

input double Lots                   = 0.1 ;

input int Expiration           = 5 ; //laikas minutemis

//---- input parameters
input int cci_p                     = 89 ;
input int ma                        = 13 ;
input int NumberOfBarsToCalculate   = 100 ;

input string    comment= ".csv  or  .txt" ; //коментарий
input string    FileType= "csv" ; //тип файла 

datetime op_time= 0 ,cl_time= 0 ;
double   op_price= 0 ,cl_price= 0 ;
int op_type= 0 ;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick ( void )
  {
   
   int     cnt,ticket,total;

   

//---
   if ( Bars <cci_p+ 1 )
     {
       Print ( "bars less than " ,cci_p);
       return ;
     }

//--- to simplify the coding and speed up access data are put into internal variables
   double cci_dn= iCustom ( NULL , 0 , "cci_ma" ,cci_p,ma,NumberOfBarsToCalculate, 2 , 0 );
   double cci_up= iCustom ( NULL , 0 , "cci_ma" ,cci_p,ma,NumberOfBarsToCalculate, 3 , 0 );
   

   total= OrdersTotal ();
   if (total< 1 )
     {
       //--- check for long position (BUY) possibility
       if (cci_up> 0 && cci_up!= EMPTY_VALUE )
        {
         ticket= OrderSend ( Symbol (),OP_BUY,Lots,Ask, 3 , 0 , 0 , "cci sample" , 16384 , 0 ,Green);
         if (ticket> 0 )
           {
             if ( OrderSelect (ticket,SELECT_BY_TICKET,MODE_TRADES))
               
               op_time= TimeLocal ();
               op_price=Close[ 0 ];
               op_type= 1 ;
               Print ( "BUY order opened : " ,OrderOpenPrice());
               Print ( "op_price : " ,op_price, "op_time : " ,op_time);
           }
         else
             Print ( "Error opening BUY order : " , GetLastError ());
         return ;
        }
       //--- check for short position (SELL) possibility
       if (cci_dn< 0 && cci_dn!= EMPTY_VALUE )
        {
         ticket= OrderSend ( Symbol (),OP_SELL,Lots,Bid, 3 , 0 , 0 , "cci sample" , 16384 , 0 ,Red);
         if (ticket> 0 )
           {
             if ( OrderSelect (ticket,SELECT_BY_TICKET,MODE_TRADES))
               
               op_time= TimeLocal ();
               op_price=Close[ 0 ];
               op_type=- 1 ;
               Print ( "BUY order opened : " ,OrderOpenPrice());
               Print ( "op_price : " ,op_price, "op_time : " ,op_time);
           }
         else
             Print ( "Error opening SELL order : " , GetLastError ());
        }
       //--- exit from the "no opened orders" block
       return ;
     }
//--- it is important to enter the market correctly, but it is more important to exit it correctly...   
   for (cnt= 0 ;cnt<total;cnt++)
     {
       if (! OrderSelect (cnt,SELECT_BY_POS,MODE_TRADES))
         continue ;
       if (OrderType()<=OP_SELL &&   // check for opened position 
         OrderSymbol()== Symbol ())   // check for symbol
        {
         //--- long position is opened
         if (OrderType()==OP_BUY)
           {
             //--- should it be closed?
             if ( TimeCurrent ()>=op_time+Expiration* 60 )
              {
               //--- close order and exit
               if (!OrderClose(OrderTicket(),OrderLots(),Bid, 3 ,Violet))
               
               cl_time= TimeCurrent (); //op_time+Expiration*60;
               cl_price=Close[ 0 ];               
               
               Print ( "OrderClose error " , GetLastError ());               
               
              PrintToFile(op_price, cl_price, op_type, op_time, cl_time);
      
               return ;
              }  
           }
         else // go to short position
           {
             //--- should it be closed?
             if ( TimeCurrent ()>=op_time+Expiration* 60 )
              {
               //--- close order and exit
               if (!OrderClose(OrderTicket(),OrderLots(),Ask, 3 ,Violet))
               cl_time= TimeCurrent (); //op_time+Expiration*60;
               cl_price=Close[ 0 ];              
               
               Print ( "OrderClose error " , GetLastError ());               
               
               PrintToFile(op_price, cl_price, op_type, op_time, cl_time);
                  
               return ;
              }         
           }
        }
     }
//---
  }
//+------------------------------------------------------------------+
void PrintToFile( double opPrice= 0 , double clPrice= 0 , int opType= 0 , datetime opTime= 0 , datetime clTime= 0 )
{
   string fileName= StringConcatenate ( Symbol (), " " , Period (), " " , "gi_EA_cci" );
   
   int handle;
   handle= FileOpen (fileName+FileType, FILE_WRITE | FILE_READ , ";" );
               if (handle!= INVALID_HANDLE )
               {
                   PrintFormat ( "Файл %s открыт для записи" ,fileName);
                   PrintFormat ( "Путь к файлу: %s\\Files\\" , TerminalInfoString ( TERMINAL_DATA_PATH ));
                   //--- сначала запишем количество сигналов
                   FileSeek (handle, 0 , SEEK_END );
                   FileWrite (handle,
                           opPrice,
                           clPrice,
                           opType,                           
                           TimeToString (opTime, TIME_MINUTES | TIME_SECONDS ), 
                           TimeToString (clTime, TIME_MINUTES | TIME_SECONDS ));
      
      
                   //--- закрываем файл
                   FileClose (handle);
                   PrintFormat ( "Данные записаны, файл %s закрыт" ,fileName);
               }
               else
               PrintFormat ( "Не удалось открыть файл %s, Код ошибки = %d" ,fileName, GetLastError ());
}
 
올빼미의 계정에서 자금 인출을 결정하는 방법을 알려주십시오.
 
beginner :
올빼미의 계정에서 자금 인출을 결정하는 방법을 알려주십시오.

일부 "주문"의 경우 OrderType()은 수치적으로 6과 같은 값을 제공합니다. 이는 인출 및 예금입니다.

OrderSelect()를 성공적으로 호출 한 후(true 반환), OrderProfit()에서 반환된 값과 이 값의 부호로 인출/보충 금액을 결정할 수 있습니다.

또한 일부 중개인은 수수료를 청구하여 수수료 금액에 대해 계정에서 인출하는 것을 시뮬레이션합니다. OrderComment()를 사용하여 커미션을 받은 주석으로 계정에서 인출과 수수료 청구를 분리할 수 있습니다.

그러나 주의해야 합니다. 이것은 모두 문서화되지 않았으며 언제든지 작동을 중지할 수 있습니다.

 
simpleton :


덕분에!
 
친애하는 프로그래머! Expert Advisor를 최적화 할 때 저는 개인적으로 다른 많은 참가자와 마찬가지로 최대 손실 대비 이익의 최대 비율(비율: 이익 / 손실)을 찾으려고 노력합니다. 이것이 가장 중요한 지표인 것 같습니다. 테스터 실행이 완료된 후 이 절차를 수동으로 수행합니다. 이 프로세스를 자동화할 수 있습니까? 또는 여러분 각자가 이 매개변수를 어떻게 정의합니까? 미리 감사드립니다.
 
yosuf :
친애하는 프로그래머! EA를 최적화할 때 저는 개인적으로 다른 많은 참가자와 마찬가지로 최대 손실 대비 이익의 최대 비율(비율: 이익 / 손실)을 찾으려고 노력합니다. 이것이 가장 중요한 지표인 것 같습니다. 테스터 실행이 완료된 후 이 절차를 수동으로 수행합니다. 이 프로세스를 자동화할 수 있습니까? 또는 여러분 각자가 이 매개변수를 어떻게 정의합니까? 미리 감사드립니다.

나는 이것을 좋아한다

 //+---------------------- OnTester() --------------------------------+
double OnTester ()
{
double Result     = 0 ;
double Profit     = TesterStatistics ( STAT_PROFIT );
double Drowdown   = TesterStatistics ( STAT_EQUITY_DD );

if (Drowdown> 0 )
Result = Profit/Drowdown;
else Result = 0 ;

   return ( NormalizeDouble (Result, 2 ));
}
//+------------------------------------------------------------------+