[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 30

 
I saw Dimka again! He put a ribbon on the car. And now he's gassing, gassing, the light's blinking, but there's nothing on the speedometer! He's worried that he won't be able to drive to work tomorrow! What do you think?
 
villy:
I saw Dimka again! He put a ribbon on the car. And now he's gassing, gassing, the light's blinking, but there's nothing on the speedometer! He's worried that he won't be able to drive to work tomorrow! What do you think?

Have you tried treatment?
 
May be, who solved it and is such solution possible in mt4. Not found. Need an EA or a script that monitors other EA's trading (EA trades on different pairs with the same magik). And after closing each order a check on reaching the magik profit (previously entered in the EA settings). If the profit is higher or equal, the following EA should stop trading by the EA. In addition to this trading advisor, there are others trading on the account. As found the EA EquityLimits(_http://mtexperts.narod.ru/files/EquityLimits_EA.ex4) monitors the current difference between the account balance and funds and, if the specified limits are reached, it closes all orders and disables all advisors (by pressing the "Advisors" button on the toolbar). This point is not satisfied.
 
granit77:

42
laveosa 22.12.2012 14:46 | banned| delete
I have a very strange case here. I am testing the adviser on the history from 2004 to 2012 and the result is one, positive, and then I do a test on the period from 2009 to 2012 and it is just completely different. a large number of orders, over 20000 for a period of 8 years. when the test is large, then the profitability bar chart shows that from 2009 to 2012 profit is clean and beautiful and when you test any distance less than 2009 then just CHAOS. Do you happen to know what it could be. Thanks in advance guys :)


Well, I would say that your EA is overoptimized... But if it was from 2004 to 2012 and then from 2009 to 2012, then most probably in the interval from 2004 to 2008 inclusively, some order got hung open, which successfully (or maybe unsuccessfully) closed at the end of testing.
 
evgenGX:
May be, who solved it and is such solution possible in mt4. Not found. Need an EA or a script that monitors other EA's trading (EA trades on different pairs with the same magik). And after closing each order a check on reaching a profit on the magik (previously entered in the EA settings). At a profit higher or equal, the following EA should stop trading by the EA. In addition to this trading EA, there are other trades on the account. As found EA EquityLimits(_http://mtexperts.narod.ru/files/EquityLimits_EA.ex4) monitors the current difference between the account balance and funds and in case of reaching the specified limits, it closes all orders and disables all advisors (clicks the "Advisors" button on the toolbar). This point is not satisfied.

First of all, reaching the profit on magic... that's something new))) Well, if there are a lot of Expert Advisors, why not use global variables for each of them
 

help eh!!!!

how do i get the number of losing orders (closed in history) from the last 10 closed orders ???

there is a function but it only searches for one specific order

here:

double WW1(int stop,int mn=-1, string sy="", int op=-1 ) {
datetime t;
double ocp, osl;
int dg, i, j=-1, k=OrdersHistoryTotal() -1 ;<-- here we can change the serial number of the order from the end (-1 is the penultimate, if we remove -1 it's the last, etc.)etc.)

if (sy=="0") sy=Symbol();
for (i=0; i<k; i++) {
if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
if (OrderSymbol()==sy || sy=="") {
if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
if (op<0 || OrderType()==op) {
if (mn<0 || OrderMagicNumber()==mn) {
if (t<OrderCloseTime()) {
t=OrderCloseTime();
j=i;
}
}
}
}
}
}
}
if (OrderSelect(j, SELECT_BY_POS, MODE_HISTORY)) {

double rr=OrderProfit();


}
return(rr);
}


using this function, of course I define loss or gain type

Does anybody have a function that reads the last 10 orders and gives the number of losing orders of them?

 

There is, of course, a suggestion to make this function a bool function type, to get true or false answers,

but then we will need 10 such functions with different numbers (from 1 to -9) and then we will get number of false and true

then who can advise how to receive number of falsities and falsities?

but this is a lot of operations and formulas, i consider it a perversion

 
evgenGX:
May be, who solved it and is such solution possible in mt4. Not found. Need an EA or a script that monitors other EA's trading (EA trades on different pairs with the same magik). And after closing each order a check on reaching the magik profit (previously entered in the EA settings). If the profit is higher or equal, the following EA should stop trading by the EA. In addition to this EA, there are other trades on the account. As found EA EquityLimits(_http://mtexperts.narod.ru/files/EquityLimits_EA.ex4) monitors the current difference between the account balance and funds and in case of reaching the specified limits, it closes all orders and disables all EAs (by pressing the "EAs" button on the toolbar). This point is not satisfied.
Two Expert Advisors can "communicate" with each other through global variables of the terminal. The following EA creates a GV variable, e.g. Symbol_STOP, after the specified event (closure of all orders) and sets the variable to 1. And the trading EA monitors the variable and if it finds this variable and its value is 1, the EA will exit (return).
 
gheka:

help eh!!!!

How to get the number of losing orders (closed in the history) of the last 10 closed orders?

i use this function to define loss or gain type

maybe there is a function that reads the last 10 orders immediately and gives a number of losing orders of them?


that's how it's solved
int num_losed,tt,check=10;
for(tt=OrdersHistoryTotal()-1;tt>=0;tt--) if(OrderSelect(tt,SELECT_BY_POS,MODE_HISTORY) && OrderSymbol()==Symbol() && OrderMagicNumber()==magic) {
if(OrderProfit()<0) num_losed++;
check--;
if(check<=0) break;

}

 
keep87:


When the code exceeds 1000 lines, you start writing compact )

also in MT4 the performance suffers, especially when running tests. The laconic version performs faster.


From what I hear the compiler removes all the "gaps" when compiling the code. Logically it should not care what option to write for performance, because in the output of the compiled file will be the same "without voids".

Isn't it so?