[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 499

 
Zhunko:
More is possible for 32. Only the motherboard limits this. It seems that up to 200 GB can be connected. I saw a table somewhere.
Vadim, is this the kind of unlock you mean?
 
TarasBY:
You can Google "Windows Task Scheduler". You can check it out here.
Do you need to create separate programs (tasks) to disable enabled terminals?
 
yosuf:
Do you need to create separate programmes (tasks) to disable enabled terminals?
Docent, read the document at TarasBY 's link carefully and don't make up nonsense.
 

Here's my test raw owl tutorial:

//+---------------------------------------------------------------------------------------+
//|                               Strategy №1 for H1.mq4                                  |
//|                                        hoz                                            |
//|                                                                                       |
//+---------------------------------------------------------------------------------------+
#property copyright "hoz"
#property link      ""

//----- Входные параметры -----------
extern string     H1 = "___ Общие параметры индикаторов ___";
extern int        i_TF = 60;
extern string     H2 = "_____ Параметры быстрой машки _____";
extern int        i_maFastPeriod = 5,
                  i_maFastShift = 0,
                  i_maFastMethod = 1;
extern string     H3 = "____ Параметры медленной машки ____";
extern int        i_maSlowPeriod = 19,
                  i_maSlowShift = 0,
                  i_maSlowMethod = 1;
extern string     H4 = "_______ Параметры Моментума _______";
extern int        i_momPeriod = 18;
extern string     H5 = "_______ Параметры Стохастика ______";
extern int        i_stoch_D = 3,                   // Сигнальная линия
                  i_stoch_K = 13,                  // Главная линия
                  i_stoch_slowing = 3;             // Замедление
                  
int g_ticket,                                      // Тикет текущей позиции
    g_type;                                        // Тип текущей позиции

//Иднентификаторы типов сигналов
#define CROSSINGTOUP                 1             // Пересечение быстрой медленную снизу вверх
#define CROSSINGTODOWN              -1             // Пересечение быстрой медленную сверху вниз
#define CROSSINGWAIT                 0             // Отсуствие пересечения машек

#define SIGNAL_BUY                   1             // Сигнал покупки
#define SIGNAL_SELL                 -1             // Сигнал продажи
#define SIGNAL_NO                    0             // Отсуствие сигнала

//+---------------------------------------------------------------------------------------+
//| Функция инициализации эксперта                                                        |
//+---------------------------------------------------------------------------------------+
int init()
  {
   
   return(0);
  }
//+---------------------------------------------------------------------------------------+
//| Функция деинициализации эксперта                                                      |
//+---------------------------------------------------------------------------------------+
int deinit()
  {

   return(0);
  }

//+---------------------------------------------------------------------------------------+
//| Проверка пересечения скользящих средних                                               |
//+---------------------------------------------------------------------------------------+
int GetCrossingMa(double& i_maFast1, double& i_maFast2, double& i_maSlow1, double& i_maSlow2)
{
      if ((i_maFast2<i_maSlow2) && (i_maFast1>i_maSlow1))             // Если быстрая скользящая пересекла медленную снизу вверх..
      return(CROSSINGTOUP);                                           //.. значит, - пересечение вверх
                                                 
      if ((i_maFast2>i_maSlow2) && (i_maFast1<i_maSlow1))             // Если быстрая скользящая средняя пересекла медленную сверху вниз..
      return(CROSSINGTODOWN);                                         //..значит, - пересечение вниз
 
   return(CROSSINGWAIT);                                              // Ожидаем пересечения
}

//+---------------------------------------------------------------------------------------+
//| Получение сигнала от Стохастика                                                       |
//+---------------------------------------------------------------------------------------+
int GetStochSignal(double& stochD1, double& stochD2, double& stochK1, double& stochK2)
{
   for(int i=1;i<=Bars;i++)
   {
      if((stochD2<stochK2) && (stochD1>stochK1))                     // Если сигнальная линия пересекла главную снизу вверх..
      return(CROSSINGTOUP);                                          //..значит, - пересечение вверх
      if((stochD2>stochK2) && (stochD1<stochK1))                     // Если сигнальная линия пересекла главную сверху вниз..
      return(CROSSINGTODOWN);                                        // ..значит, - пересечение вниз
   }
   return(CROSSINGWAIT);                                             // Ожидаем пересечения
}

//+---------------------------------------------------------------------------------------+
//| Получение сигнала от Моментума                                                        |
//+---------------------------------------------------------------------------------------+
void GetMomentumSignal()
{
   double momentum = iMomentum(Symbol(),i_TF,i_momPeriod,0,0);
}

//+---------------------------------------------------------------------------------------+
//| Получение общего сигнала для входа в рынок                                            |
//+---------------------------------------------------------------------------------------+
int GetSignal()
{
   for(int i=1;i<=Bars;i++)
   {
      double i_maFast1 = iMA(Symbol(),i_TF,i_maFastPeriod,i_maFastShift,i_maFastMethod,0,i);      // Вычисляем быстрые скользящие..
      double i_maFast2 = iMA(Symbol(),i_TF,i_maFastPeriod,i_maFastShift,i_maFastMethod,0,i+1);    //..средние
      double i_maSlow1 = iMA(Symbol(),i_TF,i_maSlowPeriod,i_maSlowShift,i_maSlowMethod,0,i);      // Вычисляем медленные скользящие..
      double i_maSlow2 = iMA(Symbol(),i_TF,i_maSlowPeriod,i_maSlowShift,i_maSlowMethod,0,i+1);    //..средние
      double stochD1 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,1,i);     // Вычисляем значения сигнальной линии..
      double stochD2 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,1,i+1);   //..стохастика
      double stochK1 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,0,i);     // Вычисляем значения главной линии..
      double stochK2 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,0,i+1);   //..стохастика
   }
      if( GetCrossingMa(double& i_maFast1, double& i_maFast2, double& i_maSlow1, double& i_maSlow2)==CROSSINGTOUP || i_maFast1>i_maSlow1 )
      return(SIGNAL_BUY);
}

//+---------------------------------------------------------------------------------------+
//| Поиск своих ордеров                                                                   |
//+---------------------------------------------------------------------------------------+
void FindOrders()
{
   
}
//+---------------------------------------------------------------------------------------+
//| Функция start эксперта                                                                |
//+---------------------------------------------------------------------------------------+
int start()
  {
//----
   
//----
   return(0);
  }

int GetCrossingMa(double& i_maFast1, double& i_maFast2, double& i_maSlow1, double& i_maSlow2) function gets the crossing signal.

intGetStochSignal(double& stochD1, double& stochD2, double& stochK1, double& stochK2) function receives signal from stochastic.

The void GetMomentumSignal() function gets the value of momentum.

The int GetSignal() will get the general signal based on the previous 3 functions and not only them. The question is this. Since theint GetSignal() function is the main one, so to speak, and it gets the main signal, I get all the values of the flaps(i_maFast1,i_maFast2, i_maSlow1 andi_maSlow2) and stochastics(stochD1,stochD2,stochK1,stochK2)

Was I correct in optimizing the code?

Of course, all parameters obtained in the functionGetSignal() are passed by reference to the corresponding functions.

But here this fragment

     if( GetCrossingMa(double& i_maFast1, double& i_maFast2, double& i_maSlow1, double& i_maSlow2)==CROSSINGTOUP || i_maFast1>i_maSlow1 )
      return(SIGNAL_BUY);

there is an error at compilation:

'&' - variable expected E:\Insall'd soft's\Forex\Admiral Markets\experts\Strategy №1 for H1.mq4 (109, 31)
'&' - variable expected	E:\Insall'd soft's\Forex\Admiral Markets\experts\Strategy №1 for H1.mq4 (109, 50)
'&' - variable expected	E:\Insall'd soft's\Forex\Admiral Markets\experts\Strategy №1 for H1.mq4 (109, 69)
'&' - variable expected	E:\Insall'd soft's\Forex\Admiral Markets\experts\Strategy №1 for H1.mq4 (109, 88)
4 ошибок, 0 предупреждений
Why?

 
I don't like poking around in left-hand code, but it immediately struck my eye why there is an & (!) after double in functions. This is what causes errors!
 
hoz:

Here's my test raw owl tutorial:

an error pops up when compiling:

Why?

Because:

//+---------------------------------------------------------------------------------------+
//| Получение общего сигнала для входа в рынок                                            |
//+---------------------------------------------------------------------------------------+
int GetSignal()
{
   for(int i=1;i<=Bars;i++)
   {
      double i_maFast1 = iMA(Symbol(),i_TF,i_maFastPeriod,i_maFastShift,i_maFastMethod,0,i);      // Вычисляем быстрые скользящие..
      double i_maFast2 = iMA(Symbol(),i_TF,i_maFastPeriod,i_maFastShift,i_maFastMethod,0,i+1);    //..средние
      double i_maSlow1 = iMA(Symbol(),i_TF,i_maSlowPeriod,i_maSlowShift,i_maSlowMethod,0,i);      // Вычисляем медленные скользящие..
      double i_maSlow2 = iMA(Symbol(),i_TF,i_maSlowPeriod,i_maSlowShift,i_maSlowMethod,0,i+1);    //..средние
      double stochD1 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,1,i);     // Вычисляем значения сигнальной линии..
      double stochD2 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,1,i+1);   //..стохастика
      double stochK1 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,0,i);     // Вычисляем значения главной линии..
      double stochK2 = iStochastic(Symbol(),i_TF,i_stoch_D,i_stoch_K,i_stoch_slowing,0,0,0,i+1);   //..стохастика
   }
      if( GetCrossingMa(i_maFast1, i_maFast2, i_maSlow1, i_maSlow2)==CROSSINGTOUP || i_maFast1>i_maSlow1 )
      return(SIGNAL_BUY);
}
 
borilunad:
I don't like digging in custom code, but I immediately noticed why there is & (!) after double in functions. This is what causes errors!

So it makes sense. It means transferring parameters via links.

To avoid explaining the code in details, I will explain it briefly.

There are 3 functions:(int GetCrossingMa, int GetStochSignal and int GetSignal())

The int GetSignal() function gets values of flaps and other indicators which are passed by referenceto non-core functions(int GetCrossingMa andint GetStochSignal) to get corresponding signals in them. I want to do it to avoid getting the same data in different functions. I don't think it's wise to calculate the same mask in 2 or more functions. It's easier to just calculate it once, and that's it. Why waste additional resources on this?

 
hoz:

So it makes sense. It means transferring parameters via links.

To avoid explaining the code in details, I will explain it briefly.

There are 3 functions:(int GetCrossingMa, int GetStochSignal and int GetSignal())

The int GetSignal() function gets values of flaps and other indicators which are passed by referenceto non-core functions(int GetCrossingMa andint GetStochSignal) to get corresponding signals in them. I want to do it to avoid getting the same data in different functions. I don't think it's wise to calculate the same masks in 2 or more functions. It's easier to just calculate it once, and that's it. Why waste additional resources on this?

Have you programmed in a language other than µl4?

 
hoz:

Here's my test raw owl tutorial:

int GetCrossingMa(double& i_maFast1, double& i_maFast2, double& i_maSlow1, double& i_maSlow2) function gets the crossing signal.

intGetStochSignal(double& stochD1, double& stochD2, double& stochK1, double& stochK2) function receives signal from stochastic.

The void GetMomentumSignal() function gets the value of momentum.

The int GetSignal() will get the general signal based on the previous 3 functions and not only them. The question is this. Since theint GetSignal() function is the main one, so to speak, and it gets the main signal, I get all the values of the flaps(i_maFast1,i_maFast2, i_maSlow1 andi_maSlow2) and stochastics(stochD1,stochD2,stochK1,stochK2)

Was I correct in optimizing the code?

Of course, all parameters obtained in the functionGetSignal() are passed by reference to the corresponding functions.

But here this fragment

there is an error during compilation:

Why?

This may be a variant of signal search on the bar we need:

//+---------------------------------------------------------------------------------------+
//| Проверка пересечения скользящих средних                                               |
//+---------------------------------------------------------------------------------------+
int GetCrossingMa (int fi_Bar = 1)
{
    double i_maFast1 = iMA (Symbol(), i_TF, i_maFastPeriod, i_maFastShift, i_maFastMethod, 0, fi_Bar),      // Вычисляем быстрые скользящие..
           i_maFast2 = iMA (Symbol(), i_TF, i_maFastPeriod, i_maFastShift, i_maFastMethod, 0, fi_Bar + 1),    //..средние
           i_maSlow1 = iMA (Symbol(), i_TF, i_maSlowPeriod, i_maSlowShift, i_maSlowMethod, 0, fi_Bar),      // Вычисляем медленные скользящие..
           i_maSlow2 = iMA (Symbol(), i_TF, i_maSlowPeriod, i_maSlowShift, i_maSlowMethod, 0, fi_Bar + 1);    //..средние
//----
    if (i_maFast2 < i_maSlow2) if (i_maFast1 > i_maSlow1)             // Если быстрая скользящая пересекла медленную снизу вверх..
    return (CROSSINGTOUP);                                           //.. значит, - пересечение вверх
    if (i_maFast2 > i_maSlow2) if (i_maFast1 < i_maSlow1)             // Если быстрая скользящая средняя пересекла медленную сверху вниз..
    return (CROSSINGTODOWN);                                         //..значит, - пересечение вниз
//----
    return (CROSSINGWAIT);                                              // Ожидаем пересечения
}

//+---------------------------------------------------------------------------------------+
//| Получение сигнала от Стохастика                                                       |
//+---------------------------------------------------------------------------------------+
int GetStochSignal (int fi_Bar = 1)
{
    double stochD1 = iStochastic (Symbol(), i_TF, i_stoch_D, i_stoch_K, i_stoch_slowing, 0, 0, 1, fi_Bar),     // Вычисляем значения сигнальной линии..
           stochD2 = iStochastic (Symbol(), i_TF, i_stoch_D, i_stoch_K, i_stoch_slowing, 0, 0, 1, fi_Bar + 1),   //..стохастика
           stochK1 = iStochastic (Symbol(), i_TF, i_stoch_D, i_stoch_K, i_stoch_slowing, 0, 0, 0, fi_Bar),     // Вычисляем значения главной линии..
           stochK2 = iStochastic (Symbol(), i_TF, i_stoch_D, i_stoch_K, i_stoch_slowing, 0, 0, 0, fi_Bar + 1);   //..стохастика
//----
      if (stochD2 < stochK2) if (stochD1 > stochK1)                     // Если сигнальная линия пересекла главную снизу вверх..
      return (CROSSINGTOUP);                                          //..значит, - пересечение вверх
      if (stochD2 > stochK2) if (stochD1 < stochK1)                     // Если сигнальная линия пересекла главную сверху вниз..
      return (CROSSINGTODOWN);                                        // ..значит, - пересечение вниз
   }
//----
   return (CROSSINGWAIT);                                             // Ожидаем пересечения
}
//+---------------------------------------------------------------------------------------+
//| Получение сигнала от Моментума                                                        |
//+---------------------------------------------------------------------------------------+
double GetMomentumSignal (int fi_Bar = 0)
{return (iMomentum (Symbol(), i_TF, i_momPeriod, 0, fi_Bar));}
//+---------------------------------------------------------------------------------------+
//| Получение общего сигнала для входа в рынок                                            |
//+---------------------------------------------------------------------------------------+
int GetSignal (int fi_Bar = 1)
{
    int li_Signal;
//----
      double ld_SignalMomentum = GetMomentumSignal (fi_Bar);
      int    li_SignalStoch = GetStochSignal (fi_Bar),
             li_CrossingMA = GetCrossingMa (fi_Bar);
//----
    return (li_Signal);
}

And in the last function GetSignal() you make "adding" of all signals (by yourself).

P.S. There is a "delicate" moment in getting the signal from the indicator. For example, you can fix the fact of finding maSlow over / under maFast, or you can "catch" the moment of their intersection. The approach and the code are different.

 
Roman.:

Have you programmed in a language other than µl4?


A little bit in Perl and a little bit in Pxp. But I haven't seriously approached other languages as I haven't needed to. Does it matter?