Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1152

 

BenditO:
укажите на пост где есть пример чтобы можно было решить такую задачу: есть индикатор№1 на чарте с с десятком графических буферов(не машки и прочая лабутень) и надо чтобы подвальный индикатор№2 брал несколько буферов от индикатора№1 и показывал их в виде гиксограмм (да не важно как) уже в подвале. Зараннее благодарю.  Для МТ5.

//#property indicator_chart_window 
#property indicator_separate_window

int OnInit()
  {
  //--- создание указателя на объект - индикатор 
   Onei_handle1=iCustom(Symbol(),PERIOD_CURRENT,"One-v5",1);
   if(Onei_handle1<0)
     {Print("Объект Onei_handle1 не создан = ",INVALID_HANDLE);Print("Ошибка исполнения = ",GetLastError());return(-1);}

   SetIndexBuffer(0,ExtOpenBuffer,INDICATOR_DATA);
   ArraySetAsSeries(ExtOpenBuffer,true);
  
   SetIndexBuffer(1,ExtColorsBuffer,INDICATOR_COLOR_INDEX);
   ArraySetAsSeries(ExtColorsBuffer,true);

   SetIndexBuffer(2,Buffer1,INDICATOR_CALCULATIONS);
   ArraySetAsSeries(Buffer1,true);
   SetIndexBuffer(3,Buffer2,INDICATOR_CALCULATIONS);
   ArraySetAsSeries(Buffer2,true);
   return(INIT_SUCCEEDED);
  }

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[])
  {

 if(!X_FromBuffers(Buffer1,Buffer2,Onei_handle1,количество_копируемых_значений)) return(0);

//////////////////////////////////

for(int i=0;(i<=количество_копируемых_значений -1 && i<количество_значений_в_индикаторе-6 && !IsStopped()); i++)
        {
//необходимые действия с буферами
        };
/////////////////////////////////
   return(rates_total);
  }
//+------------------------------------------------------------------+ 
//| Заполняем индикаторные буферы из индикатора iStochastic          | 
//+------------------------------------------------------------------+ 
bool X_FromBuffers(double &main_buffer[],// индикаторный буфер значений Stochastic Oscillator 
                   double &signal_buffer[],  // индикаторный буфер сигнальной линии 
                   int ind_handle,           // хэндл индикатора iStochastic 
                   int amount                // количество копируемых значений 
                   )
  {
//--- сбросим код ошибки   
   ResetLastError();
//--- заполняем часть массива StochasticBuffer значениями из индикаторного буфера под индексом 0 
   if(CopyBuffer(ind_handle,0,0,amount,main_buffer)<0)
     {
      //--- если копирование не удалось, сообщим код ошибки 
      PrintFormat("Не удалось скопировать данные из индикатора iStochastic, код ошибки %d",GetLastError());
      //--- завершим с нулевым результатом - это означает, что индикатор будет считаться нерассчитанным 
      return(false);
     }
//--- заполняем часть массива SignalBuffer значениями из индикаторного буфера под индексом 1 
   if(CopyBuffer(ind_handle,4,0,amount,signal_buffer)<0)
     {
      //--- если копирование не удалось, сообщим код ошибки 
      PrintFormat("Не удалось скопировать данные из индикатора iStochastic, код ошибки %d",GetLastError());
      //--- завершим с нулевым результатом - это означает, что индикатор будет считаться нерассчитанным 
      return(false);
     }
//--- все получилось 
   return(true);
  }

 
Franklins100:
Members of the forum, I am creating my own robot in Metatrader. Can someone from the guru of this forum contact me and help me with information. Thank you very much.

The forum is there to help. Voice your problem - describe it. You can get help.

 
Members of the forum a word of help! I want to write an assistant for megatrade 4.5 to learn and want to know a few nuances: For a faster and more effective learning need a powerful processor or video card? For example I can adjust settings for learning and with a weak iron learning will take a week, and with a stronger - is there any particular correlation with iron power or not?
 
Franklins100:
Members of the forum a word of help! I want to write an assistant for megatrade 4.5 to learn and want to know a few nuances: For a faster and more effective learning need a powerful processor or video card? For example I can adjust settings for learning, and with a weak iron learning will take a week, and with a stronger - is there any particular dependence on the power of iron or not?
They will be happy to tell you here.
 
I'll start at the beginning, I want to write an advisor. How does the computer hardware affect the learning. How much increases the learning time of Expert Advisor with more indicators and history? And if the hardware affects it greatly, which hardware component is more important?
 
Franklins100:
I'll start at the beginning, I want to write an advisor. How does the computer hardware affect the learning. How much longer training time of Expert Advisor increases with increasing the number of indicators and history? And if the hardware strongly affects, what hardware component is more important?

is it someone or something ? be specific...

 
Iurii Tokman:

is training someone or something ?


Wrote an EA, threw in 4 indicators, 2 years of history - a month runs my PC. How can this time be shortened ?

 
Franklins100:

Wrote an EA, threw in 4 indicators, 2 years of history - a month runs my PC. What is the best way to reduce this time?

optimise code

 
Franklins100:

Wrote an EA, threw in 4 indicators, 2 years of history - a month runs my PC. How can I reduce this time?

Optimise the code.

 
Vitaly Muzichenko:

Optimise code.

Iurii Tokman:

optimise code

Thanks for the answers. Code by code. The code will be optimised, but as new indicators are added and history is increased the 'run' time increases. How much does the PC hardware affect the 'run' time (need a tricked out CPU or GPU)? There are a huge number of questions and I'd love to talk to a guru about it)
Reason: