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

 
drknn:

Nah, nobody wants to discuss admins :)) Except maybe here...

I'm not discussing anyone! Thanks in advance for the advice on where and what.

 
lx-7:

I'm not discussing anything! Thanks in advance for the advice on where and what.


Moderator, in the annals of this masterpiece, definitely in the annals - such a hell of a way to fix in the forum museum :))
 
sss2019:

Please write an example of a function for copying a file from folder to folder, so that it can be called somehow from an Expert Advisor.


In what programming language?

I have it in my EA:

// файл сформирован. Рассылаем его  ------------
 for(i=0;i<ArraySize(Spisok);i++){
  Otkuda=TerminalPath()+"\\experts\\files\\"+RealFileName;
  Kuda=Spisok[i]+RealFileName;
  CopyFiles(Otkuda,Kuda);
}
 
Where is write protection and how do I get it out? I open normally on one computer but not on another?
sergeev:

open from a normal location. you have write protection.
 
Hello all, could you please change the settings to set a common take profit for buy and sell trades at the same price, with a plus of a certain number of points?
double TP= NormalizeDouble (spred+TakeProfit*Point,Digits);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
   for (int iq=total-1; iq>=0; iq--)
   {
    if(OrderSelect(iq, SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)
       {   
        if (OrderType()==OP_BUY  &&  OrderTakeProfit()==0 && b==1) 
         {
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(OrderOpenPrice()+TP,Digits),0,Blue);  
         }     
        if (OrderType()==OP_SELL && OrderTakeProfit()==0 && s==1) 
         {
          OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),NormalizeDouble(OrderOpenPrice()-TP,Digits),0,Blue);  
         }
}}}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
double nn=0,bb=0;
for(int ui=total-1; ui>=0; ui--)
  {
   if(OrderSelect(ui,SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol())
        {
         if(OrderType()==OP_BUY && OrderMagicNumber()==Magic)
           {
            double op=OrderOpenPrice();
            double llot=OrderLots();
            double itog=op*llot;
            bb=bb+itog;
            nn=nn+llot;
            double factb=bb/nn;
           }
        }
     }
  }
double nnn=0,bbb=0;
for(int usi=total-1; usi>=0; usi--)
  {
   if(OrderSelect(usi,SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol())
        {
         if(OrderType()==OP_SELL && OrderMagicNumber()==Magic)
           {
            double ops=OrderOpenPrice();
            double llots=OrderLots();
            double itogs=ops*llots;
            bbb=bbb+itogs;
            nnn=nnn+llots;
            double facts=bbb/nnn;
           }
        }
     }
  }

for(int uui=total-1; uui>=0; uui--)
  {
   if(OrderSelect(uui,SELECT_BY_POS))
     {
      if(OrderSymbol()==Symbol())
        {
         if(b>=2 && OrderType()==OP_BUY && OrderMagicNumber()==Magic)
           {
            OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),factb+CORR,0,Blue);
           }
         if(s>=2 && OrderType()==OP_SELL && OrderMagicNumber()==Magic)
           {
            OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),facts-CORR,0,Blue);
           }
        }
     }
  }
 
This is a question guys, is it technically possible to set different stoplosses and takeprofits for buy and sell positions in an EA?
 
RMX13:
This is a question guys, is it technically possible to set different stoplosses and takeprofits for buy and sell positions in an EA?

The answer is positive. Different stop order levels can be set separately for each of the six order types.
 
drknn:

The answer is positive. Different stop order levels can be set separately for each of the six order types.

Separate levels can be set for each order individually
lx-7:

I'm shocked, I'm shocked at the admins.


What is the shock ?
 
When optimising, the EA produces different results every time. Why?
 
gsg1963:
When optimising, the EA produces different results every time. Why?

Spread is different
Reason: