[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 315

 
Do you know if the strategy tester has any limits on the number of passes? I ran the tester, at the bottom left above the bar at the beginning of the test was: 0/1280 (25706). I counted 25 kopecks - that's the number of all possible combinations. But he finished the test when it was: 1088/1280 (25706). So he only made 1088 passes? What do the first two digits even mean?
Moreover, it counts somehow strangely... when he added another criterion for 3 parameters, the 25 pieces didn't increase by 3 times, but gave something like 40 koz. Is it a glitch or am I wrong somewhere?
 
AndrejFX:
Do you know if the strategy tester has any limits on the number of passes? I ran the tester, at the bottom left above the bar at the beginning of the test was: 0/1280 (25706). I counted 25 kopecks - that's the number of all possible combinations. But he finished the test when it was: 1088/1280 (25706). So he only made 1088 passes? What do the first two digits even mean?
Moreover, it counts somehow strangely... when he added another criterion for 3 parameters, the 25 pieces didn't increase by 3 times, but gave something like 40 koz. Is it a glitch or am I wrong somewhere?
read the manual. it is detailed there personally.
 

Help sort out the trailing code!!!

Should trawl already open StopLosses at "TrailingStop" distance, from High or Low level, of previous candlesticks. Once the Expert Advisor is started, it only works with an order on the first open trade. Once StopLoss is triggered and the next trade is opened, the StopLoss order is not trailed. If I understand correctly, this is because the variable "ORDER_SL" is not changed and the condition of changing the order is not fulfilled? If so, why and how to correct it?

Here's the trailing code:

int ORDER=OrdersTotal();    
OrderSelect(ORDER,SELECT_BY_TICKET,MODE_TRADES);
int ORDER_Type=OrderType();
double ORDER_SL=OrderStopLoss();
double Point_High=iHigh(OrderSymbol(),0,2)-TrailingStop*Point;
double Point_Low=iLow(OrderSymbol(),0,2)+TrailingStop*Point;
            if (ORDER_Type==OP_BUY && ORDER_SL<Point_High){
                    OrderModify(OrderTicket(),OrderOpenPrice(),Point_High,OrderTakeProfit(),0,CLR_NONE);
                    while(!IsTradeAllowed()) Sleep(100);
            }
            if (ORDER_Type==OP_SELL && ORDER_SL>Point_Low){
                    OrderModify(OrderTicket(),OrderOpenPrice(),Point_Low,OrderTakeProfit(),0,CLR_NONE);
                    while(!IsTradeAllowed()) Sleep(100);
            }

Here is the EA in full:

Files:
 

This code

int ORDER=OrdersTotal();    
OrderSelect(ORDER,SELECT_BY_TICKET,MODE_TRADES);

should be put in perls. The most interesting thing is that it works, but only in the tester on the first order.

 
Christoff:

Help with trailing!!!

Should trawl already open StopLosses at the distance of "TrailingStop", from the level of High or Low, the previous candlesticks. After starting the Expert Advisor works only with an order on the first open trade. Once StopLoss is triggered and the next trade is opened, the StopLoss order is not trailed. If I understand correctly, this is because the variable "ORDER_SL" is not changed and the condition of changing the order is not fulfilled? And if so, why and how to correct it?

Here is the trawl code:

Here is the Expert Advisor in full:

Before you trawl something, you need to select it. You first need to loop through all of the open positions of the terminal, selecting those that are opened by the Expert Advisor. At each iteration of the loop, if the required order is selected, call your trawl directly from the loop. Only in this case, all of the positions opened by the Expert Advisor will be trawled.

Approximately so:

void Trailing(string sy, int mn) 
{
   int      i, err, ORDER_Type, k=OrdersTotal();
   double   PointX, ORDER_SL, Point_High, Point_Low;
 
   if (sy=="0") sy=Symbol();
   int    dg=MarketInfo(sy, MODE_DIGITS);
   double pt=MarketInfo(sy, MODE_POINT);
   
   if(dg==5 || dg==3) PointX=pt*10;
   if(dg==4 || dg==2) PointX=pt;
   
   for (i=0; i<k; i++) {
      if (OrderSelect(i, SELECT_BY_POS)) {
         if (OrderSymbol()!=sy)        continue;
         if (OrderType()>1)            continue;
         if (OrderMagicNumber()!=mn)   continue;
               
         ORDER_Type=OrderType();
         ORDER_SL=OrderStopLoss();
         Point_High=iHigh(OrderSymbol(),0,2)-TrailingStop*PointX;
         Point_Low=iLow(OrderSymbol(),0,2)+TrailingStop*PointX;
         if (ORDER_Type==OP_BUY)
            if (NormalizeDouble(Point_High-ORDER_SL,dg)>0) {
            OrderModify(OrderTicket(),OrderOpenPrice(),Point_High,OrderTakeProfit(),0,CLR_NONE);
            while(!IsTradeAllowed()) Sleep(100);
            }
         if (ORDER_Type==OP_SELL)
            if (NormalizeDouble(ORDER_SL-Point_Low,dg)>0) {
            OrderModify(OrderTicket(),OrderOpenPrice(),Point_Low,OrderTakeProfit(),0,CLR_NONE);
            while(!IsTradeAllowed()) Sleep(100);
            }
         }
      if (!OrderSelect(i, SELECT_BY_POS)) {
         err=GetLastError();
         Print("FUNC Trailing: Ошибка выбора ордера - ", err);
         break;
         }
      }
   return;
}

I have not looked at the code of your trawl, but left it as it is (though I should also change it - add a check for StopLevel not to be exceeded, or maybe something else), and added only a loop on orders and normalization when comparing doubles in your trawl code, and so on ... some useful stuff ... You will figure it out if you want to :)

ZS. I haven't reviewed the code, I wrote it as is, so there may be errors. It's just an example.

Now, in that code place where you need to trawl positions, call this function:

Trailing(Symbol(), Magic);
Magic - magic number set in the EA as a unique integer so that it can distinguish its own orders from orders of another EA or from manually opened orders where there is no magic number at all.
If we leave Symbol() in the function call, the positions of the symbol on which our EA is standing will be targeted.
Alternatively, instead of Symbol(), you can replace it with the name of the currency pair whose positions you want to trawl.
 
Please help me to exchange data in the fastest way between MT4 terminals on one computer.
 
trave:
Please help me to exchange data in the fastest way between MT4 terminals on one computer.

If you need to copy trades, then here is the copyer. If you just exchange data, then you need to make a dll
Files:
kopirowshik.zip  465 kb
 
drknn:

If you want to copy trades, here's the copier. If you just want to exchange data, you have to make a dll

Happy holidays to you... :-)))
 
Vinin:

You shouldn't be posting stolen stuff on this forum. It's a road to banishment.

is in the figurative sense, this turkey has been finalised by me.
 
Roman.:
Happy holidays to you... :-)))
Vladimir, since you've posted a compilation, you must have dealt with this issue.
Have you found a ready simple variant of transferring one variable from terminal to terminal via memory, Windows variable, etc., i.e. not via file?
As a final variant, an indicator that draws the Close[0] line from another terminal on one terminal online. On a tick chart this comparison would look very clear.