OI in ritardo (interesse aperto) - pagina 6

 
Renat Akhtyamov:

Ha una stanza privata per questo.

E ora lei sta scrivendo ai media, quindi stiamo avendo una discussione.

Ti sto anche dicendo chiaramente: usa il sincrono.

Io uso il sincrono, cos'altro posso fare da un sottomarino.

 
Dmi3:

....., ma non sono contento del meccanismo che prostotrader usa con i maghi storti.


O non capisci affatto la natura dei maghi "storti" o non vuoi capirla.

https://www.mql5.com/ru/blogs/post/557544

Отслеживание ордера, после команды OrderSendAsync
Отслеживание ордера, после команды OrderSendAsync
  • 2016.10.29
  • www.mql5.com
Отслеживание ордера, после команды OrderSendAsync Михаил | 23 апреля, 2015 В статье рассказывается принцип отслеживания ордера после команды OrderSendAsync, если нет события TradeTransaction
 
prostotrader:

O non capite affatto i maghi "storti" o non volete capirli.

https://www.mql5.com/ru/blogs/post/557544

Perché? Capisco esattamente come funziona. Ma non voglio perdere i maghi "etero". Senza di loro sarebbe difficile per me scoprire rapidamente dove e cosa c'è nel mio conto in questo momento.

 
Dmi3:

Perché? Capisco esattamente come funziona. Ma non voglio perdere le medaglie "dirette". Senza di loro sarebbe difficile per me capire rapidamente dove e cosa c'è nel mio conto al momento.

Il majik è grande, e sia la parte costante (id della strategia, per esempio) che la parte "variabile" (numero di richiesta) possono essere avvolte in esso.

 
Stanislav Korotky:

Il majik è grande, quindi puoi avvolgere in esso sia la parte costante (id della strategia, per esempio) che la parte "variabile" (numero della query).

ha un int, non un long
 
Renat Akhtyamov:
Ha un int, non un lungo

Non ci crederete : ) Anche con int magic puoi scambiare 1000+ EAs con 1000000+ combinazioni di strategie in ognuno.

 
prostotrader:

Si sente una campana, ma non si sa dove sia.

"Colpire" il codice pubblicato.

......

Come puoi parlare di risultati se il codice è scritto male?

......

Così tanti "scrittori" di Expert Advisors, si aggrappano al lavoro per MICEX, non conoscendo nemmeno molte basi del trading sul mercato azionario e dei derivati!


Ne stai facendo un uso eccessivo! La ragazza se la cavava bene, soprattutto rispetto ai personaggi dei temi vicini, che cercano di ottenere venditori nel Mercato senza nemmeno passare i voti in Informatica con BASIC))

 
Aleksey Mavrin:

Non ci crederete : ) Anche con int magic puoi scambiare 1000+ EAs con 1000000+ combinazioni di strategie in ognuno.

E se avete la logica nel vostro cervello, starete bene senza maghi.

A proposito, stavo solo dicendo di int per andare lungo se è troppo interessante.

dal momento che il programmatore, per così dire...
 
Aleksey Mavrin:


Ne stai facendo un dramma! La ragazza era a posto, soprattutto rispetto ai personaggi dei fili vicini, che vanno al mercato come venditori senza nemmeno passare il test di base).

cosa c'è che non va in lei?

non sa nemmeno quale dovrebbe essere il suo rendimento o cosa deve fare per ottenerlo.

Anche l'esperto non mi ha detto la domanda difficile, perché non si può parlarne ad ogni angolo

Tuttavia, so come ottenere il giusto risultato, perché ho dedicato circa 5 anni allo studio di questo argomento.

 
Dmi3:

Perché? Capisco esattamente come funziona. Ma non voglio perdere le medaglie "dirette". Senza di loro sarebbe difficile per me scoprire rapidamente dove e cosa c'è nel mio conto in questo momento.

Se scrivete così, non capite come funziona il tutto!

I bit alti del Majic sono formati dal nome del simbolo, inoltre, è possibile assegnare un ID ad ogni EA, e i bit bassi

creare una serie di majicle di bambini.

Quindi, devi affermare di aver capito come funziona!

//+------------------------------------------------------------------+
//|                                                    AutoMagic.mqh |
//|                                 Copyright 2017-2018 prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
//version   "1.02
ulong symb_magic;
int exp_id;
//-------------------------------------------------------------------+
// Split string function                                             |
//+------------------------------------------------------------------+
string SplitString(const string a_str,ulong &a_month,ulong &a_year)
  {
   int str_size=StringLen(a_str);
   int str_tire=StringFind(a_str, "-");
   int str_tochka=StringFind(a_str, ".", str_tire);
   if((str_tire>0) && (str_tochka>0) &&(str_size > 0))
     {
      a_month= ulong(StringToInteger(StringSubstr(a_str,str_tire+1,str_tochka-str_tire-1)));
      a_year = ulong(StringToInteger(StringSubstr(a_str,str_tochka+1,str_size-str_tochka-1)));
      if((a_month > 0) && (a_year > 0)) return(StringSubstr(a_str, 0, str_tire));
     }
   return("");
  }
//-------------------------------------------------------------------+
// Get Magic function                                                |
//+------------------------------------------------------------------+
ulong GetMagic(const string a_symbol, const int sov_id)
{
  exp_id = -1;
  symb_magic = 0;
  if(SymbolSelect(Symbol(), true) == false)
  {
    Print(__FUNCTION__, ": Нет такого символа!");
    return(0);
  }
  ulong month = 0;
  ulong year = 0;
  string new_str = SplitString(a_symbol,month,year);
  if(StringLen(new_str)>0)
  {
    uchar char_array[];
    int result=StringToCharArray(new_str, char_array, 0, WHOLE_ARRAY, CP_ACP);
    if(result>0)
   {
     ulong value;
     for(int i = 0; i < result - 1; i++)
     {
       value=ulong(char_array[i]);
       value<<=(56 -(i*8));
       symb_magic += value;
     }
     month<<=24;
     symb_magic += month;
     year<<=16;
     symb_magic += year;
     exp_id = sov_id;      //New!!!
     int s_id = exp_id;
     s_id<<=8;             //New !!!   
     symb_magic += s_id;   //New !!!
     return(symb_magic);
   }
 }
  return(0); 
}
//-------------------------------------------------------------------+
// Is my magic function                                              |
//+------------------------------------------------------------------+
bool IsMyMagic(const ulong m_magic)
{
  if(m_magic > 0)
  {
    ulong stored_magic = symb_magic;
   // stored_magic>>=16;
    stored_magic>>=8;   //New!!!
    ulong in_magic = m_magic;
   // in_magic>>=16;
    in_magic>>=8;      //New!!!
    if(in_magic == stored_magic) return(true);
  }  
  return(false);
}
//-------------------------------------------------------------------+
// Get stored magic function                                         |
//+------------------------------------------------------------------+
ulong GetStoredMagic()
{
  if(symb_magic > 0) return(symb_magic);
  return(0);  
}
//-------------------------------------------------------------------+
// Get expert ID function                                            |
//+------------------------------------------------------------------+
int GetExpertId()
{
  return(exp_id);                //New!!!
}
//+------------------------------------------------------------------+

Controlla

//+------------------------------------------------------------------+
//|                                                   Test_magic.mq5 |
//|                                      Copyright 2021 prostotrader |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021 prostotrader"
#property link      "https://www.mql5.com"
#property version   "1.00"
#include "AutoMagic.mqh"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   ulong new_magic = GetMagic(Symbol(), 22);
   Print("Magic is: ", new_magic);
   ulong f_magic = new_magic;
   ulong a_letter = (f_magic>>56)&255;
   Print("7 byte: ", CharToString(uchar(a_letter)));   
   f_magic = new_magic;
   a_letter = (f_magic>>48)&255;
   Print("6 byte: ", CharToString(uchar(a_letter))); 
   f_magic = new_magic;
   a_letter = (f_magic>>40)&255;
   Print("5 byte: ", CharToString(uchar(a_letter))); 
   f_magic = new_magic;
   a_letter = (f_magic>>32)&255;
   Print("4 byte: ", CharToString(uchar(a_letter))); 
   f_magic = new_magic;
   a_letter = (f_magic>>24)&255;
   Print("3 byte (month): ", a_letter);
   f_magic = new_magic;
   a_letter = (f_magic>>16)&255;
   Print("2 byte (year)): ", a_letter);
   f_magic = new_magic;
   a_letter = (f_magic>>8)&255;
   Print("1 byte (expert id or series of magics): ", a_letter);
   f_magic = new_magic;
   a_letter = (f_magic&255);
   Print("0 byte (series of magics): ", a_letter);
//---
   return(INIT_SUCCEEDED);
  }

Risultato

2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       Magic is: 5138409554846225920
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       7 byte: G
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       6 byte: O
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       5 byte: L
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       4 byte: D
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       3 byte (month): 3
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       2 byte (year)): 21
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       1 byte (expert id or series of magics): 22
2021.01.19 03:05:15.363 Test_magic (GOLD-3.21,M1)       0 byte (series of magics): 0

Cambia il simbolo e l'id dell'EA in 122

2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        Magic is: 5932457868670630400
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        7 byte: R
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        6 byte: T
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        5 byte: S
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        4 byte: 
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        3 byte (month): 3
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        2 byte (year)): 21
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        1 byte (expert id or series of magics): 122
2021.01.19 03:07:06.225 Test_magic (RTS-3.21,M1)        0 byte (series of magics): 0

Aggiungi al codice

   for(int i = 0 ; i<256;i++)
   {
     Print("My magic: ", string(IsMyMagic(new_magic + ulong(i))));
}Print("My magic: ", string(IsMyMagic(new_magic + ulong(256))));

Risultato

2021.01.19 10:25:45.855 Test_magic (RTS-3.21,M1)        My magic: true
2021.01.19 10:25:45.855 Test_magic (RTS-3.21,M1)        My magic: true
2021.01.19 10:25:45.855 Test_magic (RTS-3.21,M1)        My magic: true
2021.01.19 10:25:45.855 Test_magic (RTS-3.21,M1)        My magic: true
2021.01.19 10:25:45.855 Test_magic (RTS-3.21,M1)        My magic: true
2021.01.19 10:25:45.855 Test_magic (RTS-3.21,M1)        My magic: true
2021.01.19 10:25:45.855 Test_magic (RTS-3.21,M1)        My magic: true
.......................................................................
2021.01.19 10:53:40.451	Test_magic (RTS-3.21,M1)	My magic: false

Il nome del simbolo + EA id farà in modo che il magik sia unico,

e nel byte 0, una serie di majics figli (anch'essi unici).

Il magik verrà creato automaticamente.

Dato che il login standard di FORTS è limitato a 30 tr./sec, 256 magie per bambini vi basteranno senza 1 byte.

E tutto questo "ballare con le nocche" è necessario solo in casi estremi, quando la connessione è persa (il server MT5 si è bloccato) e non hai ricevuto un ordine di ticket.

Документация по MQL5: Предопределенные переменные / _Symbol
Документация по MQL5: Предопределенные переменные / _Symbol
  • www.mql5.com
_Symbol - Предопределенные переменные - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5