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

 

Is it possible to improve the performance of an EA if the indicator used in it, which is called through iCustom(), is completely transferred to a dll? Is such a game worth playing? Is the dll always faster than the indicator? And what are the peculiarities of working with Close[] array in dll?


Yes, I will also add a question: how to format IndicatorCounted() function in dll.

 
gyfto:

1. Is it possible to get the EA performance gain, if the indicator used in it, which is called via iCustom(), is completely transferred to a dll? Is such a game worth playing? Is the dll always faster than the indicator? And what are the peculiarities of working with Close[] array in a dll?


2. Yes, I would also like to add a question: how to design the IndicatorCounted() function in dll.

It is an interesting topic. But...

1. I don't know, I haven't tried it, but I doubt it, it may be an insignificant increment. From what I've seen indicators transferred to dll do not work fast, but optimizing the code of the indicator allows to achieve very good results in mql.

There is no cheat here, we should pass the value of IndicatorCounted(), Bars and in the dll we should decide whether to re-count all or only one bar. Instead of IndicatorCounted() and Bars, you can pass already calculated Limit.

Clearly, if the indicator is very slow, which makes it unrealistic for use in Expert Advisors (you can not test it), then the transfer to the dll will not help.

 
gyfto:

1. Is it possible to get the EA performance gain, if the indicator used in it, which is called via iCustom(), is completely transferred to a dll? Is such a game worth playing? Is the dll always faster than the indicator? And what are the peculiarities of working with Close[] array in dll?
2. Yes, I will also add a question: how to format IndicatorCounted() function in dll?

1. Sure, you may and should. It is 20 times faster in calculation. Not to mention convenient debugging and infinite possibilities of C++ and other normal languages.

2. you don't need it there.

 
Why is the line breaking downwards? I need a section by EMPTY. code with an error for H1 (I can see that myself), but how do I fix EMPTY???
SetIndexStyle(0,EMPTY);
 
Why is the line breaking downwards? I need a section by EMPTY. code (page 427) with an error for H1 (I can see that myself), but how do I fix EMPTY???
SetIndexStyle(0,EMPTY);
 
kopeyka:
Why does the line break down? I need a section by EMPTY. code with an error for H1 (I can see that myself), but how do I fix EMPTY???

Try setting SetIndexEmptyValue(), options: 0, EMPTY_VALUE

 
Integer:

Try setting SetIndexEmptyValue(), options: 0, EMPTY_VALUE


Thanks...I'll give it a try)):
 
Integer:

...

1. I don't know I haven't tried...

Tried it. EMA on mql and in 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

A few tests:

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

This is quite noticeable. If calculations are more complicated, the code will be much more noticeable.

 
IF THE ORDER TICKET IS STORED ON THE BROKER'S SERVER, WHERE ARE THE MAGIC AND COMMENT ORDERS STORED?
 

Good day!!! I must have misunderstood something about arrays or something. The function does not put a profit in the array!!! It's zero in all circumstances. Zero and that's it!

Function.

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


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;
         
         
}        
    

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

Oblivion beyond all functions

double Orderasthitaem[6,2];ArrayInitialize(Orderasthitaem, 0.0);
Reason: