[ARCHIVIO]Qualsiasi domanda da principiante, per non ingombrare il forum. Professionisti, non passate oltre. Non posso andare da nessuna parte senza di te - 5. - pagina 174

 
tpg_k156:
Buona giornata a tutti. Potete dirmi come copiare le transazioni in Metatrader 4. In modo che aprendo un trade su un terminale si possa ottenere un trade aperto su un altro.

Cercate in CodeBase un copiatore. Non il migliore, naturalmente, ma sono liberamente disponibili
 
Chissà se è possibile, rendendo le variabili globali Hour(), Minute() e Seconds(), controllare a mezzanotte (0.00) il cambiamento dell'indicatore DailyPivotPoints ai nuovi livelli di PP e altre linee dall'EA? Io lo facevo direttamente nell'indicatore con Hour(), Minute(), Seconds(), e funzionava senza bisogno di compilare ogni notte. Ma recentemente ha smesso di cambiare da solo, forse per aver cambiato la bild? Grazie!
 
borilunad:
Chissà se è possibile, rendendo le variabili globali Hour(), Minute() e Seconds(), controllare a mezzanotte (0.00) il cambiamento dell'indicatore DailyPivotPoints ai nuovi livelli di PP e altre linee dall'EA? Io lo facevo direttamente nell'indicatore con Hour(), Minute(), Seconds(), e funzionava senza bisogno di compilare ogni notte. Ma recentemente ha smesso di cambiare da solo, forse per aver cambiato la bild? Grazie!

Dovrebbe funzionare al primo tick del nuovo giorno.
 
borilunad:

Grazie, Victor! La mia versione breve ha funzionato per te?


Sì, Boris, è molto buono, comunque! Grazie mille. Questo è quello che volevo. Ho contorto... ho contorto... Non ho capito bene. Non ho ancora molta esperienza e il mio cervello non pensa come un professionista. È un po' un vicolo cieco, vero? :(

Non volevo chiedere, ma dovevo farlo. Perché non potevo accorciarlo da solo.

 
Puoi dirmi come costruire un canale che passa attraverso i frattali, ma è limitato a 0 barre e ridisegna ulteriormente quando appare una nuova barra. È la limitazione che è il problema.
 
beginner:
Puoi dirmi come costruire un canale che passa attraverso i frattali, ma è limitato a 0 barre e ridisegna ulteriormente quando appare una nuova barra. È la limitazione che è il problema.

Spiegare il concetto di "limitato da 0 bar".
 

Ecco la funzione:

bool IsUpFractal(int index)
{
   double centerHigh = High[index + g_center];     // За точку отсчета берется средний..
                                                   // ..бар на участке из i_fractalPeriod
                                                   // ..баров
// - 1 - == Поиск максимумов справа от центрального бара ================================
   int cnt = 0, i = index + g_center - 1;
   for (; i >= 0 && cnt < g_center; i--)           // Справа от центрального бара должно
   {                                               // ..быть g_center-1 баров с низшим..
      if (centerHigh <= High[i])                   // ..максимумом. Не позволяется..
         return (false);                           // ..наличие баров с большим или..
      cnt++;                                       // ..равным максимумом.
   }
   
   if (i < 0)                                      // g_center-1 низших максимумов не..
      return (false);                              // ..найдено. Фрактала нет
// - 1 - == Окончание блока =============================================================

// - 2 - == Поиск максимумов слева от центрального бара =================================
   cnt = 0;
   i = index + g_center + 1;
   int total = Bars - 1;
   for (; i < total && cnt < g_center; i++)        // Слева от центрального бара должно
   {                                               // ..быть g_center-1 баров с низшим..
      if (centerHigh == High[i])                   // ..максимумом. Не позволяется..
         continue;                                 // ..наличие баров с большим..
      if (centerHigh < High[i])                    // ..максимумом. Равный - позволяется
         return (false);
      cnt++;                                    
   }
   
   if (i >= total)                                 // g_center-1 низших максимумов не..
      return (false);                              // ..найдено. Фрактала нет
// - 2 - == Окончание блока =============================================================
                                                   
   return (true);                                  // Фрактал найден                 
}
//+-------------------------------------------------------------------------------------+
//| Определение наличия нижнего фрактала на указанном баре                              |
//+-------------------------------------------------------------------------------------+
bool IsDnFractal(int index)
{
   double centerLow = Low[index + g_center];       // За точку отсчета берется средний..
                                                   // ..бар на участке из i_fractalPeriod
                                                   // ..баров
// - 1 - == Поиск минимумов справа от центрального бара =================================
   int cnt = 0, i = index + g_center - 1;
   for (; i >= 0 && cnt < g_center; i--)           // Справа от центрального бара должно
   {                                               // ..быть g_center-1 баров с большим..
      if (centerLow >= Low[i])                     // ..минимумом. Не позволяется..
         return (false);                           // ..наличие баров с меньшим или..
      cnt++;                                       // .. равным минимумом
   }
   
   if (i < 0)                                      // g_center-1 больших минимумов не..
      return (false);                              // ..найдено. Фрактала нет
// - 1 - == Окончание блока =============================================================

// - 2 - == Поиск минимумов слева от центрального бара ==================================
   cnt = 0;
   i = index + g_center + 1;
   int total = Bars - 1;
   for (; i < total && cnt < g_center; i++)        // Слева от центрального бара должно
   {                                               // ..быть g_center-1 баров с большим..
      if (centerLow == Low[i])                     // ..минимумом. Не позволяется..
         continue;                                 // ..наличие баров с меньшим минимумом
      if (centerLow > Low[i])                      // ..Равный минимум - разрешается
         return (false);
      cnt++;   
   }
   
   if (i >= total)                                 // g_center-1 больших минимумов не..
      return (false);                              // ..найдено. Фрактала нет
// - 2 - == Окончание блока =============================================================
                                                   
   return (true);                                  // Фрактал найден                 
}

La funzione ottiene il valore dell'indice che ha un valore di barra per calcolare 0 o 1. Qui è dove il ciclo è scritto in un modo interessante..:

for (; i >= 0 && cnt < g_center; i--)

Cioè, non c'è un valore variabile da cui partire per il calcolo. Secondo la logica della macchina, da quale barra in questo caso partirà il calcolo? Se c'è un decremento di i, allora dal massimo?

Anche qui i = indice + g_center - 1, ma qui c'è un punto. Qualevaloredi indice arriverà quiper primo? Massimo o minimo?

 
hoz:

Cioè non c'è un valore variabile da cui partire per il calcolo. Secondo la logica della macchina, da quale barra inizierà il calcolo? Se c'è un decremento di i, è il massimo?


No, dal valore della variabile che avevo prima del ciclo. La voce

   int cnt = 0, i = index + g_center - 1;
   for (; i >= 0 && cnt < g_center; i--)

è identico a

   int cnt,i;
   for (cnt = 0, i = index + g_center - 1; i >= 0 && cnt < g_center; i--)
 
In altre parole, la prima espressione nel ciclo for può essere scritta sia al suo posto che prima del ciclo, e il risultato è lo stesso.
 
hoz:

Di nuovo, i = indice + g_center - 1, ma ecco il punto. Qual è ilprimo valore diindice che viene qui? Massimo o minimo?


L'indice sarà il valore passato alla funzione come parametro.
Motivazione: