[ARCHIVE]Toute question de débutant, afin de ne pas encombrer le forum. Professionnels, ne passez pas à côté. Je ne peux aller nulle part sans toi - 5. - page 428

 
gyfto:

1. Est-il possible d'obtenir un gain de performance de l'EA, si l'indicateur utilisé dans celui-ci, qui est appelé via iCustom(), est entièrement transféré dans une dll ? Un tel jeu en vaut-il la chandelle ? La dll est-elle toujours plus rapide que l'indicateur ? Et quelles sont les particularités du travail avec le tableau Close[] dans une dll ?


2. Oui, je voudrais aussi ajouter une question : comment traiter la fonction IndicatorCounted() dans la dll.

C'est un sujet intéressant. Mais...

1. Je ne sais pas, je n'ai pas essayé, mais j'en doute, c'est peut-être une augmentation insignifiante. De ce que j'ai vu, les indicateurs transférés en dll ne fonctionnent pas rapidement, mais l'optimisation du code de l'indicateur permet d'obtenir de très bons résultats en mql.

Il n'y a pas de triche ici, nous devrions passer la valeur de IndicatorCounted(), Bars et dans le dll nous devrions décider de recompter toutes les barres ou seulement une. Au lieu de IndicatorCounted() et Bars, vous pouvez passer une limite déjà calculée.

En clair, si l'indicateur est très lent, ce qui le rend irréaliste pour une utilisation dans les Expert Advisors (vous ne pouvez pas le tester), alors le transfert vers la dll ne sera pas utile.

 
gyfto:

1. Est-il possible d'obtenir un gain de performance de l'EA, si l'indicateur utilisé dans celui-ci, qui est appelé via iCustom(), est entièrement transféré dans une dll ? Un tel jeu en vaut-il la chandelle ? La dll est-elle toujours plus rapide que l'indicateur ? Et quelles sont les particularités du travail avec le tableau Close[] dans la dll ?
2. Oui, je vais aussi ajouter une question : comment formater la fonction IndicatorCounted() dans la dll ?

1. Bien sûr, vous pouvez et devez. Il est 20 fois plus rapide en calcul. Sans parler de la facilité de débogage et des possibilités infinies du C++ et d'autres langages normaux.

2. vous n'en avez pas besoin à cet endroit.

 
Pourquoi la ligne se casse-t-elle vers le bas ? J'ai besoin d'une section par le code EMPTY. avec une erreur pour H1 (je peux le voir moi-même), mais comment fixer EMPTY ???
SetIndexStyle(0,EMPTY);
 
Pourquoi la ligne se casse-t-elle vers le bas ? J'ai besoin d'une section par code EMPTY. (page 427) avec une erreur pour H1 (je peux le voir moi-même), mais comment fixer EMPTY ???
SetIndexStyle(0,EMPTY);
 
kopeyka:
Pourquoi la ligne tombe en panne ? J'ai besoin d'une section par le code EMPTY. avec une erreur pour H1 (je peux le voir moi-même), mais comment fixer EMPTY ???

Essayez de définir SetIndexEmptyValue(), options : 0, EMPTY_VALUE

 
Integer:

Essayez de définir SetIndexEmptyValue(), options : 0, EMPTY_VALUE


Merci...je vais essayer maintenant)) :
 
Integer:

...

1. Je ne sais pas, je n'ai pas essayé...

Je l'ai essayé. EMA sur mql et dans dll.

01:46:19 1 EURUSD,M15 : Alert : dll : 109
01:46:19 1 EURUSD,M15 : Alert : 1
01:46:19 1 EURUSD,M15 : Alert : mql : 109
01:46:19 1 EURUSD,M15 : Alert : dll : 0
01:46:19 1 EURUSD,M15 : Alert : 2
01:46:19 1 EURUSD,M15 : Alert : mql : 156
01:46:20 1 EURUSD,M15 : Alert : dll : 202
01:46:20 1 EURUSD,M15 : Alert : 3
01:46:20 1 EURUSD,M15 : Alert : mql : 172
01:46:20 1 EURUSD,M15 : Alert : dll : 0
01:46:20 1 EURUSD,M15 : Alert : 4
01:4620 1 EURUSD,M15 : Alert : mql : 172
01:46:20 1 EURUSD,M15 : Alert : dll : 171
01:46:20 1 EURUSD,M15 : Alert : 5
01:46:20 1 EURUSD,M15 : Alert : mql : 78
01:46:20 1 EURUSD,M15 : Alert : dll : 78
01:46:20 1 EURUSD,M15 : Alert : 6
01:46:21 1 EURUSD,M15 : Alert : mql : 202
01:46:21 1 EURUSD,M15 : Alert : dll : 94
01:46:21 1 EURUSD,M15 : Alert : 7
01:46:21 1 EURUSD,M15 : Alert : mql : 172
01:46:21 1 EURUSD,M15 : Alert : dll : 94
01:4621 1 EURUSD,M15 : Alert : 8
01:46:21 1 EURUSD,M15 : Alert : mql : 234
01:46:21 1 EURUSD,M15 : Alert : dll : 15
01:46:21 1 EURUSD,M15 : Alert : 9
01:46:21 1 EURUSD,M15 : Alert : mql : 78
01:46:22 1 EURUSD,M15 : Alert : dll : 94
01:46:22 1 EURUSD,M15 : Alert : 10
01:46:22 1 EURUSD,M15 : Alert : mql : 172
01:46:22 1 EURUSD,M15 : Alert : dll : 93
01:46:22 1 EURUSD,M15 : Alert : 11
01:46:22 1 EURUSD,M15 : Alert : mql : 93
01:46:22 1 EURUSD,M15 : Alert : dll : 78
01:46:22 1 EURUSD,M15 : Alert : 12
01:46:22 1 EURUSD,M15 : Alert : mql : 78
01:46:22 1 EURUSD,M15 : Alert : dll : 78
01:46:22 1 EURUSD,M15 : Alert : 13
01:46:23 1 EURUSD,M15 : Alert : mql : 250
01:4623 1 EURUSD,M15 : Alert : dll : 156
01:46:23 1 EURUSD,M15 : Alert : 14
01:46:23 1 EURUSD,M15 : Alert : mql : 187
01:46:23 1 EURUSD,M15 : Alert : dll : 0
01:46:23 1 EURUSD,M15 : Alert : 15
01:46:23 1 EURUSD,M15 : Alert mql : 78
01:46:23 1 EURUSD,M15 : Alert : dll : 171
01:46:23 1 EURUSD,M15 : Alert : 16
01:46:24 1 EURUSD,M15 : Alert : mql : 266
01:46:24 1 EURUSD,M15 : Alert : dll : 0
01:46:24 1 EURUSD,M15 : Alert : 17
01:46:24 1 EURUSD,M15 : Alert : mql : 93
01:46:24 1 EURUSD,M15 : Alert : dll : 78
01:46:24 1 EURUSD,M15 : Alert : 18
01:46:24 1 EURUSD,M15 : Alert : mql : 94
01:46:24 1 EURUSD,M15 : Alert : dll : 15
01:46:24 1 EURUSD,M15 : Alert : 19
01:46:2446:46:24 1 EURUSD,M15 : Alert : mql : 94
01:46:24 1 EURUSD,M15 : Alert : dll : 78
01:46:24 1 EURUSD,M15 : Alert : 20
01:46:25 1 EURUSD,M15 : Alert : mql : 234
01:46:25 1 EURUSD,M15 : Alert : dll : 78
01:46:25 1 EURUSD,M15 : Alert : 21
01:46:25 1 EURUSD,M15 : Alert : mql : 156
01:46:25 1 EURUSD,M15 : Alert : dll : 94
01:46:25 1 EURUSD,M15 : Alert : 22
01:46:25 1 EURUSD,M15 : Alert : mql : 94
01:46:25 1 EURUSD,M15 : Alert : dll : 16
01:46:2546:25 1 EURUSD,M15 : Alert : 23
01:46:26 1 EURUSD,M15 : Alert : mql : 93
01:46:26 1 EURUSD,M15 : Alert : dll : 171
01:46:26 1 EURUSD,M15 : Alert : 24
01:46:26 1 EURUSD,M15 : Alert : mql : 171
01:46:26 1 EURUSD,M15 : Alert : dll : 187
01:46:26 1 EURUSD,M15 : Alert : 25
01:46:26 1 EURUSD,M15 : Alert : mql : 156
01:46:26 1 EURUSD,M15 : Alert : dll : 78
01:46:26 1 EURUSD,M15 : Alert : 26
01:46:27 1 EURUSD,M15 : Alert : mql : 62
01:4627 1 EURUSD,M15 : Alert : dll : 187
01:46:27 1 EURUSD,M15 : Alert : 27
01:46:27 1 EURUSD,M15 : Alert : mql : 78
01:46:27 1 EURUSD,M15 : Alert : dll : 171
01:46:27 1 EURUSD,M15 : Alert : 28
01:46:27 1 EURUSD,M15 : Alert mql : 93
01:46:27 1 EURUSD,M15 : Alert : dll : 78
01:46:27 1 EURUSD,M15 : Alert : 29
01:46:27 1 EURUSD,M15 : Alert : mql : 172
01:46:28 1 EURUSD,M15 : Alert : dll : 94
01:46:28 1 EURUSD,M15 : Alert : Average. mql : 140 dll : 91

Quelques tests :

Moyenne. mql : 126 dll : 116
Moyenne. mql : 122 dll : 86
Moyenne. 167 dll : 91
Moyenne. mql : 149 dll : 82
Moyenne. mql : 140 dll : 91

C'est tout à fait perceptible. Si les calculs sont plus compliqués, le code sera beaucoup plus visible.

 
SI LE TICKET D'ORDRE EST STOCKÉ SUR LE SERVEUR DU COURTIER, OÙ SONT STOCKÉS LES ORDRES MAGIQUES ET LES COMMENTAIRES ?
 

Bonne journée ! !! Je dois avoir mal compris quelque chose à propos des tableaux ou autre. La fonction ne met pas un bénéfice dans le tableau ! !! C'est zéro en toutes circonstances. Zéro et c'est tout !

Fonction.

/))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))


void Orderasthitaem()
{
int BUY=0,SELL=0,BUYLIMIT=0,BUYSTOP=0,SELLLIMIT=0,SELLSTOP=0;
double BUY_Profit=0,SELL_Profit=0;
      for( int i=0;i<OrdersTotal();i++){
        OrderSelect (i, SELECT_BY_POS  ) ;  
        if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magicnumber){            
        int type = OrderType();
        if (type == 0) {BUY++;BUY_Profit=BUY_Profit+OrderProfit();}
        if (type == 1) {SELL ++;SELL_Profit=SELL_Profit+OrderProfit();}
        if (type == 2) {BUYLIMIT++;}
        if (type == 3) {SELLLIMIT++;}
        if (type == 4) {BUYSTOP++;}
        if (type == 5) {SELLSTOP++;}}}
       
        Orderasthitaem[0,1]=BUY;Orderasthitaem[0,2]=BUY_Profit;
        Orderasthitaem[1,1]=SELL;Orderasthitaem[1,2]=SELL_Profit;
        Orderasthitaem[2,1]=BUYLIMIT;
        Orderasthitaem[3,1]=SELLLIMIT;
        Orderasthitaem[4,1]=BUYSTOP;
        Orderasthitaem[5,1]=SELLSTOP;
         
         
}        
    

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

L'oubli au-delà de toute fonction

double Orderasthitaem[6,2];ArrayInitialize(Orderasthitaem, 0.0);
 
Dimka-novitsek:

Bonne journée ! !! Je dois avoir mal compris quelque chose à propos des tableaux ou autre. La fonction ne met pas un bénéfice dans le tableau ! !! C'est zéro en toutes circonstances. Zéro et c'est tout !

int Orderasthitaem[6][3];
void Orderasthitaem()
{
 int BUY = 0, SELL = 0, BUYLIMIT = 0, BUYSTOP = 0, SELLLIMIT = 0, SELLSTOP = 0;
 double BUY_Profit = 0, SELL_Profit = 0;
 for (int i = 0; i < OrdersTotal(); i++)
  {
   OrderSelect(i, SELECT_BY_POS);  
   if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magicnumber)
    {            
     int type = OrderType();
     if (type == 0) {BUY++; BUY_Profit = BUY_Profit + OrderProfit();}
     if (type == 1) {SELL ++; SELL_Profit = SELL_Profit + OrderProfit();}
     if (type == 2) {BUYLIMIT++;}
     if (type == 3) {SELLLIMIT++;}
     if (type == 4) {BUYSTOP++;}
     if (type == 5) {SELLSTOP++;}}}
       
     Orderasthitaem[0][1] = BUY;
     Orderasthitaem[0][2] = BUY_Profit;
     Orderasthitaem[1][1] = SELL;
     Orderasthitaem[1][2] = SELL_Profit;
     Orderasthitaem[2][1] = BUYLIMIT;
     Orderasthitaem[3][1] = SELLLIMIT;
     Orderasthitaem[4][1] = BUYSTOP;
     Orderasthitaem[5][1] = SELLSTOP;        
    }
  }
}
Fonction.

L'obiagraph est en dehors de toutes les fonctions.