Hatalar, hatalar, sorular - sayfa 2817

 
MQL kullanarak bu rakam üzerinde kontrol sahibi olmak mümkün mü? (bu, MT'deki grafikteki satırdan bir penceredir)
 
TesterMaxProfit.all_symbols.M1. 20200727.20200805 . 42.405 CEC9C4975113F378E5F241968A332 .opt

Söyleyin bana, oluşturulan opt dosyalarının adı hangi algoritma ile?

 

MT4'te - bana göründüğü gibi, ChartSaveTemplate(...) hatalarla çalışıyor, 1280 oluştur

işte komut dosyası:

 //+------------------------------------------------------------------+
//|                                              Test.mq4            |
//|                   Copyright 2006-2015, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright    "2006-2015, MetaQuotes Software Corp."
#property link          "http://www.mql4.com"
#property strict
#property show_inputs

void OnStart ()
{
   string s_Symbol = Symbol ();
   string s_EA_Name = "eStomper_02" ;
   string s_MagicChartIDSuffix = "MagicChart" ;
   int i_Magic = 1 ;
   string s_GlobalMagicChartID;
   string s_Period = _Period ;
   
   s_GlobalMagicChartID = StringConcatenate (s_EA_Name, "-" ,s_MagicChartIDSuffix, "-" ,i_Magic, "-" ,s_Symbol, "-" ,s_Period);
   if ( ChartSaveTemplate ( 0 ,s_GlobalMagicChartID))
   {
       Print ( "s_GlobalMagicChartID=" ,s_GlobalMagicChartID);     
   }
   else
   {
       Print ( __FUNCTION__ , " Couldnot Save template : " + s_GlobalMagicChartID + ".tpl" + "Error = " + GetLastError ());
       return ;
   }
}
//+------------------------------------------------------------------+
для М1 и М5 имя шаблона усекается, _Period - в имени шаблона не присутсвует..

смотрю полный игнор, но вот если сделать так, то все в порядке. явно в компиляторе ошибка, что-то типа неправильного выравнивания.


//+------------------------------------------------------------------+
//|                                              Test.mq4            |
//|                   Copyright 2006-2015, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright    "2006-2015, MetaQuotes Software Corp."
#property link          "http://www.mql4.com"
#property strict
#property show_inputs

void OnStart ()
{
   string s_Symbol = Symbol ();
   string s_EA_Name = "eStomper_02" ;
   string s_MagicChartIDSuffix = "MagicChart" ;
   int i_Magic = 1 ;
   string s_GlobalMagicChartID;
   string s_Period = _Period ;
   
   if (s_Period == "1" || s_Period == "5" )
   {
      s_Period = "0" + s_Period;
   }
   s_GlobalMagicChartID = StringConcatenate (s_EA_Name, "-" ,s_MagicChartIDSuffix, "-" ,i_Magic, "-" ,s_Symbol, "-" ,s_Period);
   if ( ChartSaveTemplate ( 0 ,s_GlobalMagicChartID))
   {
       Print ( "s_GlobalMagicChartID=" ,s_GlobalMagicChartID);     
   }
   else
   {
       Print ( __FUNCTION__ , " Couldnot Save template : " + s_GlobalMagicChartID + ".tpl" + "Error = " + GetLastError ());
       return ;
   }
}
//+------------------------------------------------------------------+



 
fxsaber :

Söyleyin bana, oluşturulan opt dosyalarının adı hangi algoritma ile?

Bu, EA giriş parametrelerinin değerlerinden MD5'tir (optimize edilmiş olanlar için - başlat-adım-durdur, optimize edilmemiş olanlar için - mevcut değer)

42 - gerçek keneler, sembol optimizasyonu

Торговые советники и собственные индикаторы - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
Торговые советники и собственные индикаторы - Алгоритмический трейдинг, торговые роботы - Справка по MetaTrader 5
  • www.metatrader5.com
Среди программ для автоматического трейдинга можно выделить две большие категории: торговые роботы и индикаторы. Первые предназначены для совершения торговых операций на рынках, а вторые — для анализа котировок и выявления закономерностей в их изменении. При этом индикаторы могут использоваться непосредственно в роботах, образуя полноценную...
 
Pavel Verveyko :
MQL kullanarak bu rakam üzerinde kontrol sahibi olmak mümkün mü? (bu, MT'deki grafikteki satırdan bir penceredir)
Bu kütüphane ile
 
Rorschach :
Bu kütüphane ile

çok teşekkürler

 

Zor bir soru. Gösterge tutamacı tarafından oluşturulduğu sembol ve zaman çerçevesi nasıl bulunur?

MQL API, gösterge parametrelerini okumak için IndicatorParameters işlevine sahiptir, ancak bu yeterli değildir: örneğin, sembol ve zaman çerçevesi bilinmiyorsa süreyi bilmenin amacı nedir? Ya bu bir eksiklik ya da nasıl yapıldığını bulamıyorum - lütfen bana bir bağlantı verin.

 
Stanislav Korotky :

Zor bir soru. Gösterge tutamacı tarafından oluşturulduğu sembol ve zaman çerçevesi nasıl bulunur?

imkanı yok

geçen yıl @fxsaber aynı soruyu sordu, ancak dosyalarla ilgili olarak - tanıtıcı tarafından dosya adının nasıl öğrenileceği, bir çözüm yok

sadece bu amaçlar için kendi kabınızı kullanın, burada @fxsaber'dan dosya tanıtıcısı için önerilen kabı buldum

 struct FILE
{
   const int handle;
  
  FILE( const string FileName, const int Flags ) : handle(:: FileOpen (FileName, Flags)) {}  
  ~FILE( void ) { if ( this .handle != INVALID_HANDLE ) :: FileClose ( this .handle); }
};
 
Stanislav Korotky :

Zor bir soru. Gösterge tutamacı tarafından oluşturulduğu sembol ve zaman çerçevesi nasıl bulunur?

MQL API, gösterge parametrelerini okumak için IndicatorParameters işlevine sahiptir, ancak bu yeterli değildir: örneğin, sembol ve zaman çerçevesi bilinmiyorsa süreyi bilmenin amacı nedir? Ya bu bir eksiklik ya da nasıl yapıldığını bulamıyorum - lütfen bana bir bağlantı verin.

Igor Makanu :

imkanı yok

Yapabilir.

 bool FindIndicatorByHandle( long handle, string &symbol, ENUM_TIMEFRAMES &timeframe, long &ChartId, int &sub_win, string &Name) {
   long chart_id = ChartFirst ();
   while (chart_id!=- 1 ) {
       int total_sub = ( int ) ChartGetInteger (chart_id, CHART_WINDOWS_TOTAL );
       int total_ind;
       for ( int i= 0 ; i<total_sub; i++) {
         total_ind = ChartIndicatorsTotal (chart_id,i);
         for ( int j= 0 ; j<total_ind; j++) {
             string name = ChartIndicatorName (chart_id,i,j);
             if ( ChartIndicatorGet (chart_id,i,name)== handle) {
               ChartId=chart_id;
               symbol= ChartSymbol (chart_id);
               timeframe= ChartPeriod (chart_id);
               sub_win=i;
               Name=name;
               return true ;
            }
         }
      }
      chart_id= ChartNext (chart_id);
   }
   return false ;
}

Ekli bir test komut dosyasıdır.

Komut dosyasının sonucu:

 2020.08 . 07 01 : 39 : 43.435 All_Indicators (US30Index,M1)   Market Watch: CADRUB  USDRUB  USDCAD  EURCAD  EURUSD  .BrentCrud  XAUUSD  GBPAUD  BTCUSD  US30Index  USDJPY  Symb001  USD-BTC  EURCHF  USDCHF  
2020.08 . 07 01 : 39 : 43.498 All_Indicators (US30Index,M1)   Chart EURUSD PERIOD_M1 has indicators: TestMinMax(handle= 10 )   RVI( 10 )(handle= 11 )   RSI_154( 14 )(handle= 12 )   
2020.08 . 07 01 : 39 : 43.499 All_Indicators (US30Index,M1)   Chart .BrentCrud PERIOD_M1 has indicators: 
2020.08 . 07 01 : 39 : 43.500 All_Indicators (US30Index,M1)   Chart CADRUB PERIOD_M1 has indicators: 
2020.08 . 07 01 : 39 : 43.501 All_Indicators (US30Index,M1)   Chart USDCAD PERIOD_M5 has indicators: 
2020.08 . 07 01 : 39 : 43.502 All_Indicators (US30Index,M1)   Chart US30Index PERIOD_M1 has indicators: MA( 100 )(handle= 13 )   TestMinMax(handle= 14 )   
2020.08 . 07 01 : 39 : 43.505 All_Indicators (US30Index,M1)   Chart .BrentCrud PERIOD_D1 has indicators: DinTF(handle= 15 )   
2020.08 . 07 01 : 39 : 43.509 All_Indicators (US30Index,M1)   Chart USDRUB PERIOD_M1 has indicators: Bands( 200 )(handle= 16 )   Env( 10 )(handle= 17 )   MACD( 12 , 26 , 9 )(handle= 18 )    RSI( 14 )(handle= 19 )   
2020.08 . 07 01 : 39 : 43.523 All_Indicators (US30Index,M1)   Chart EURUSD PERIOD_M30 has indicators: MA( 15 )(handle= 20 )   TestMinMax(handle= 21 )   
2020.08 . 07 01 : 39 : 43.527 All_Indicators (US30Index,M1)   Chart .BrentCrud PERIOD_M5 has indicators: 
2020.08 . 07 01 : 39 : 43.527 All_Indicators (US30Index,M1)   Chart USDCAD PERIOD_M15 has indicators: DinTF(handle= 22 )   
2020.08 . 07 01 : 39 : 43.527 All_Indicators (US30Index,M1)   Chart USDCAD PERIOD_H1 has indicators: pMa( 2 - 940 )(handle= 23 )   !Channels_3. 05 )(handle= 24 )   
2020.08 . 07 01 : 39 : 43.528 All_Indicators (US30Index,M1)   Chart USDCAD PERIOD_H4 has indicators: 
2020.08 . 07 01 : 39 : 43.528 All_Indicators (US30Index,M1)   Chart XAUUSD PERIOD_M1 has indicators: Tick(handle= 25 )   
2020.08 . 07 01 : 39 : 43.528 All_Indicators (US30Index,M1)   --------------------------------------------------------------------------------
2020.08 . 07 01 : 39 : 43.528 All_Indicators (US30Index,M1)   Попробуем найти индикатор по хэндлу h = 18
2020.08 . 07 01 : 39 : 43.529 All_Indicators (US30Index,M1)   Нашли: USDRUB   PERIOD_M1 , chart_id = 128968168864101623 , подокно = 1 , короткое имя = MACD( 12 , 26 , 9 )
Dosyalar:
 
Nikolai Semko :

Yapabilir.

Kodunuz muhtemelen çalışacaktır.

ChartIndicatorGet() 'i hiç kullanmadım, ancak şimdi yardımda buldum

ama yine de, görevin kullanıcının onu kendisinin başlattığını bulmak mümkün olsa da, gösterge tutamağını doğrudan kodunuzdaki gösterge adına bağlamak daha kolaydır.


teşekkür etmek! bilgilendirici