Hatalar, hatalar, sorular - sayfa 1935

 
Aleksey Vyazmikin :

Bu yüzden ticaret fonksiyonlarıyla ilgili olup olmadığından emin değilim ...

Şube, herkesin yeniden üretebileceği yapıcı ifadelere bir örnektir.
 
fxsaber :
Şube, herkesin yeniden üretebileceği yapıcı ifadelere bir örnektir.

Anlıyorum - Kodu gönderirdim, ancak ticaret işlevleri için henüz ödemediğim bir sınıf kullanıyor ...

Oluştururken, kademeli bir yavaşlama gözlemliyorum - maksimum hızda çubuk başına neredeyse birkaç saniye - ne olabileceği hakkında herhangi bir fikriniz var mı?

Antivirüs kontrol etmiyor, SSD vidası üzerinde boşluk var...

 
Aleksey Vyazmikin :

EA'yı MT4'ten MT5'e yeniden yazdı

Hikaye aynı, kontrol noktaları tarafından dakikalar içinde test ediliyor.

MT5

2017.07.20 20:01:38.059 Çekirdek 1 Si-9.17,M1: 107509 onay işareti, 35385 çubuk üretildi. Ortam 0:00:000.078'de senkronize edildi. Test 0:03:52.707'de geçti (0:00:00.031 ön işleme keneleri dahil).

MT4

2017.07.20 20:02:32.696 RUBRUR,M1: 225314 onay olayı (35701 çubuk, 231783 çubuk durumu) 0:00:04.259 (toplam süre 0:00 :11.310 ) içinde işlenir

Ve MT5'in övülen hızı nerede?
Her iki uzmanın kodunu da gösteriyorsunuz. Yerel MQL5 yerine tembel bir MQL4 öykünücünüz var mı?
 
Renat Fatkhullin :
Her iki uzmanın da kodunu gösteriyorsunuz. Yerel MQL5 yerine tembel bir MQL4 öykünücünüz var mı?

Bir nedenden dolayı kodu göstermeye henüz hazır değil

Ticaret, otomatik ticaret sistemleri ve ticaret stratejilerinin test edilmesi hakkında forum

Hatalar, hatalar, sorular

Aleksey Vyazmikin , 2017.07.20 23:28


Anlıyorum - Kodu gönderirdim, ancak ticaret işlevleri için henüz ödemediğim bir sınıf kullanıyor ...

Ancak MT5'ten profil çıkarmanın sonuçlarını göstermeye hazırım - anladığım kadarıyla ticaret fonksiyonlarıyla ilgili bir soru yok.



OHLC ortamı için aşağıdaki işlevleri kullanıyorum

 //-------------------------------------------------------------------
//==MQL4toMQL5
//+------------------------------------------------------------------+ 
//| Получим Open для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double Open ( int index)
  {
   double open= 0 ;
   ArraySetAsSeries ( Open , true );
   int copied= CopyOpen ( Symbol (), 0 , 0 , Bars ( Symbol (), 0 ), Open );
   if (copied> 0 && index<copied) open= Open [index];
   return (open);
  }
//+------------------------------------------------------------------+ 
//| Получим Low для заданного номера бара                            | 
//+------------------------------------------------------------------+ 
double Low ( int index)
  {
   double low= 0 ;
   ArraySetAsSeries ( Low , true );
   int copied= CopyLow ( Symbol (), 0 , 0 , Bars ( Symbol (), 0 ), Low );
   if (copied> 0 && index<copied) low= Low [index];
   return (low);
  }
//+------------------------------------------------------------------+ 
//| Получим High для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double High ( int index)
  {
   double high= 0 ;
   ArraySetAsSeries ( High , true );
   int copied= CopyHigh ( Symbol (), 0 , 0 , Bars ( Symbol (), 0 ), High );
   if (copied> 0 && index<copied) high= High [index];
   return (high);
  }
//+------------------------------------------------------------------+ 
//| Получим Close для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double Close ( int index)
  {
   double close= 0 ;
   ArraySetAsSeries ( Close , true );
   int copied= CopyHigh ( Symbol (), 0 , 0 , Bars ( Symbol (), 0 ), Close );
   if (copied> 0 && index<copied) close= Close [index];
   return (close);
  }
Belki yanlış bir şey yapıyorum?
 
Aleksey Vyazmikin :

Bir nedenden dolayı kodu göstermeye henüz hazır değil

Ancak MT5'ten profil çıkarmanın sonuçlarını göstermeye hazırım - anladığım kadarıyla ticaret fonksiyonlarıyla ilgili bir soru yok.

OHLC ortamı için aşağıdaki işlevleri kullanıyorum

Belki yanlış bir şey yapıyorum?
 double iOpen ( string symbol, ENUM_TIMEFRAMES tf, int index) {
   if (index < 0 ) return (- 1 );
   double Arr[];
   if ( CopyOpen (symbol,tf, index, 1 , Arr)> 0 )
         return (Arr[ 0 ]);
   else return (- 1 );
 }

double iClose ( string symbol, ENUM_TIMEFRAMES tf, int index) {
   if (index < 0 ) return (- 1 );
   double Arr[];
   if ( CopyClose (symbol,tf, index, 1 , Arr)> 0 )
         return (Arr[ 0 ]);
   else return (- 1 );
 }

double iHigh ( string symbol, ENUM_TIMEFRAMES tf, int index) {
   if (index < 0 ) return (- 1 );
   double Arr[];
   if ( CopyHigh (symbol,tf, index, 1 , Arr)> 0 )
         return (Arr[ 0 ]);
   else return (- 1 );
 }

double iLow ( string symbol, ENUM_TIMEFRAMES tf, int index) {
   if (index < 0 ) return (- 1 );
   double Arr[];
   if ( CopyLow (symbol,tf, index, 1 , Arr)> 0 )
         return (Arr[ 0 ]);
   else return (- 1 );
 }
 

Geçmişteki mevcut tüm çubukları kopyalıyorsunuz, ancak gerçekten yalnızca bir aranmış dizine ihtiyacınız var

 CopyOpen ( Symbol (), 0 , index , Bars ( Symbol (), 0 ) 1 , Open );
 
Vitaly Muzichenko :

Geçmişteki mevcut tüm çubukları kopyalıyorsunuz, ancak gerçekten yalnızca bir aranmış dizine ihtiyacınız var

Tarifine göre değiştirdim ve danışman siparişleri açmayı bıraktı... belki yine batırdı?


 //-------------------------------------------------------------------
//==MQL4toMQL5
//+------------------------------------------------------------------+ 
//| Получим Open для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double Open ( int index)
  {
   double open= 0 ;
   ArraySetAsSeries ( Open , true );
   int copied= CopyOpen ( Symbol (), 0 ,index, 1 , Open );
   if (copied> 0 && index<copied) open= Open [index];
   return (open);
  }
//+------------------------------------------------------------------+ 
//| Получим Low для заданного номера бара                            | 
//+------------------------------------------------------------------+ 
double Low ( int index)
  {
   double low= 0 ;
   ArraySetAsSeries ( Low , true );
   int copied= CopyLow ( Symbol (), 0 ,index, 1 , Low );
   if (copied> 0 && index<copied) low= Low [index];
   return (low);
  }
//+------------------------------------------------------------------+ 
//| Получим High для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double High ( int index)
  {
   double high= 0 ;
   ArraySetAsSeries ( High , true );
   int copied= CopyHigh ( Symbol (), 0 ,index, 1 , High );
   if (copied> 0 && index<copied) high= High [index];
   return (high);
  }
//+------------------------------------------------------------------+ 
//| Получим Close для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double Close ( int index)
  {
   double close= 0 ;
   ArraySetAsSeries ( Close , true );
   int copied= CopyHigh ( Symbol (), 0 ,index, 1 , Close );
   if (copied> 0 && index<copied) close= Close [index];
   return (close);
  }


  
//+------------------------------------------------------------------+ 
//| Получим IOpen для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double iOpen ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double open= 0 ;
   ArraySetAsSeries (OpenI, true );
   int copied= CopyOpen (symbol,timeframe,index, 1 ,OpenI);
   if (copied> 0 && index<copied) open=OpenI[index];
   return (open);
  }
//+------------------------------------------------------------------+ 
//| Получим iLow для заданного номера бара                            | 
//+------------------------------------------------------------------+ 
double iLow ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double low= 0 ;
   ArraySetAsSeries (LowI, true );
   int copied= CopyLow (symbol,timeframe,index, 1 ,LowI);
   if (copied> 0 && index<copied) low=LowI[index];
   return (low);
  }
//+------------------------------------------------------------------+ 
//| Получим iHigh для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double iHigh ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double high= 0 ;
   ArraySetAsSeries (HighI, true );
   int copied= CopyHigh (symbol,timeframe,index, 1 ,HighI);
   if (copied> 0 && index<copied) high=HighI[index];
   return (high);
  }
//+------------------------------------------------------------------+ 
//| Получим iClose для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double iClose ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double close= 0 ;
   ArraySetAsSeries (CloseI, true );
   int copied= CopyHigh (symbol,timeframe,index, 1 ,CloseI);
   if (copied> 0 && index<copied) close=CloseI[index];
   return (close);
  }
 
Aleksey Vyazmikin :

Tarifine göre değiştirdim ve danışman siparişleri açmayı bıraktı... belki yine batırdı?


 double Close ( int index)
  {
   double close= 0 ;
   ArraySetAsSeries ( Close , true );
   int copied= Copy High ( Symbol (), 0 ,index, 1 , Close );
   if (copied> 0 && index<copied) close= Close [index];
   return (close);
  }

Kapat != Yüksek


not. konu bu değil buraya yaz

Konuyu çöpe atmamak için moderatörlerden gönderileri doğru başlığa taşımalarını rica ediyorum.

Вопросы от начинающих MQL5 MT5 MetaTrader 5
Вопросы от начинающих MQL5 MT5 MetaTrader 5
  • 2012.03.12
  • www.mql5.com
Подскажите пожалуйста, такой показатель тестера в жизни реален? И хороший это или плохой результат за год с депо 3000...
 
Vitaly Muzichenko :

Kapat != Yüksek

not. konu bu değil buraya yaz

Konuyu çöpe atmamak için moderatörlerden gönderileri doğru başlığa taşımalarını rica ediyorum.

Teşekkürler - düzeltildi.

sonunda kod şu şekilde

 //-------------------------------------------------------------------
//==MQL4toMQL5
//+------------------------------------------------------------------+ 
//| Получим Open для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double Open ( int index)
  {
   double open= 0 ;
   int copied= CopyOpen ( Symbol (), 0 ,index, 1 , Open );
   if (copied> 0 ) open= Open [ 0 ];
   return (open);
  }
//+------------------------------------------------------------------+ 
//| Получим Low для заданного номера бара                            | 
//+------------------------------------------------------------------+ 
double Low ( int index)
  {
   double low= 0 ;
   int copied= CopyLow ( Symbol (), 0 ,index, 1 , Low );
   if (copied> 0 ) low= Low [ 0 ];
   return (low);
  }
//+------------------------------------------------------------------+ 
//| Получим High для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double High ( int index)
  {
   double high= 0 ;
   int copied= CopyHigh ( Symbol (), 0 ,index, 1 , High );
   if (copied> 0 ) high= High [ 0 ];
   return (high);
  }
//+------------------------------------------------------------------+ 
//| Получим Close для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double Close ( int index)
  {
   double close= 0 ;
   int copied= CopyClose ( Symbol (), 0 ,index, 1 , Close );
   if (copied> 0 ) close= Close [ 0 ];
   return (close);
  }


  
//+------------------------------------------------------------------+ 
//| Получим IOpen для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double iOpen ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double open= 0 ;
   int copied= CopyOpen (symbol,timeframe,index, 1 ,OpenI);
   if (copied> 0 ) open=OpenI[ 0 ];
   return (open);
  }
//+------------------------------------------------------------------+ 
//| Получим iLow для заданного номера бара                            | 
//+------------------------------------------------------------------+ 
double iLow ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double low= 0 ;
   int copied= CopyLow (symbol,timeframe,index, 1 ,LowI);
   if (copied> 0 ) low=LowI[ 0 ];
   return (low);
  }
//+------------------------------------------------------------------+ 
//| Получим iHigh для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double iHigh ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double high= 0 ;
   int copied= CopyHigh (symbol,timeframe,index, 1 ,HighI);
   if (copied> 0 ) high=HighI[ 0 ];
   return (high);
  }
//+------------------------------------------------------------------+ 
//| Получим iClose для заданного номера бара                           | 
//+------------------------------------------------------------------+ 
double iClose ( string symbol, ENUM_TIMEFRAMES timeframe, int index)
  {
   double close= 0 ;
   int copied= CopyClose (symbol,timeframe,index, 1 ,CloseI);
   if (copied> 0 ) close=CloseI[ 0 ];
   return (close);
  }

Test cihazında geçen süre uzadı - ben zaten beklemekten bıktım :)

 

Cari ay için geçmişte işlem gören lotları sayıyorum.

   double lots= 0 ;
   for ( int i= OrdersHistoryTotal ()- 1 ;i>= 0 ;i--)
       if ( OrderSelect (i, SELECT_BY_POS , MODE_HISTORY ))
         if ( TimeMonth ( OrderCloseTime ())== TimeMonth ( TimeCurrent ()))
             if ( OrderType ()< 2 )
               lots+= OrderLots ();

Terminal geçmişinde belirli bir süre için, örneğin son üç gün için siparişleri gösterirsem, OrdersHistoryTotal () yalnızca son üç günü görür.

Bunun doğru olmadığını düşünüyorum, OrdersHistoryTotal () tüm geçmişteki tüm siparişleri görmeli ve programcı tarih ve dönemlere göre filtrelemeli.

Aksi takdirde, kullanıcı tarafından geçmişi yanlış gizlemek sorunlara yol açabilir....