[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 522

 
No. This problem will not be solved.
 

And how do you implement an order change if its take profit is not equal to a specific price. I have done it like this

if(OrderTakeProfit() != buytakeprofit)
          {
          if(OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),buytakeprofit,OrderExpiration(),Green) == false)
            {
            Print("Ошибка модифицирования ордера ",GetLastError());
            }
          }
For example buytakeprofit equals 1.2555

It turns out that if take profit of the order is NOT equal to 1.2555, then there is a modification of the order which gives out error 1, which means that I am trying to set the same value. But if take profit is already equal to this price, then why does the OrderTakeProfit() condition kick in = buytakeprofit?

 

Because it's not normalised

double nd(double in){return(NormaliseDouble(in,Digits));}
/*-------------------------------------------------------*/
if(nd(OrderTakeProfit())!=nd(новая цена)){then GO!!! :);}
 
Oh, I've long wanted to ask -- the dependence of scrolling speed at 32 speeds on mouse movements -- is that the intention?
 

How would you better organise the maximum drawdown of the EA, at which it stops working, can you set a static variable that will accumulate the amount of losses?

The Expert Advisor should stop working, but it will start working again after restarting or changing parameters.

 
Alert(iBars(NULL, 1),"  ",GetLastError()); // получаем ошибку - 4066

// ждем мально, повторяем запрос, все нормально...
// потом обновляем окошко с этим таймфреймом вручную, и получаем вот такую запись в журнале:

2012.01.23 11:26:04     HistoryCenter: 3235 bars imported in 'SILVER1'

After that, you start to doubt the correctness of the program's behaviour, can you please explain what the trick is?

The program after the generated error accessed the historical centre and got the necessary quotes, but it turns out that not all of them? Or what is the meaning of this?

 
fore-x:

After that, you start to doubt the correctness of the program's behaviour, can you please explain what the trick is?

The program after the generated error accessed the historical centre and got the necessary quotes, but it turns out that not all of them? Or what is the meaning of this?

https://www.mql5.com/ru/forum/116126
 

Comrades, we need some advice. What to fix so that prices are written to the file correctly. Now the EA sometimes outputs what's in the red circle, see the image below. I am pasting the code of the Expert Advisor and a picture of what is written to the file)

//+------------------------------------------------------------------+
//|                                                          TP1.mq4 |
//|                                                      S.I.Shlikov |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "S.I.Shlikov"
#property link      ""
int init()  
  {
   string Name=Symbol();
   int h=FileOpen(Symbol()+"-"+Period()+".csv",FILE_CSV|FILE_WRITE|FILE_READ,";");
    if(h<1)
      {
      Print("Файл не найден : ", GetLastError());
      return(false);
      }
   FileSeek(h, 0, SEEK_END);
   FileWrite(h,"Date",Name,"Period",Period());
   FileClose(h);        
  }
int start()
  {
   int h=FileOpen(Symbol()+"-"+Period()+".csv",FILE_CSV|FILE_WRITE|FILE_READ,";");
    if(h<1)
      {
      Print("Файл C не найден : ", GetLastError());
      return(false);
      }
   string Wtime=TimeToStr(TimeCurrent(),TIME_DATE|TIME_MINUTES);
   FileSeek(h, 0, SEEK_END);
   FileWrite(h,Wtime,NormalizeDouble(Close[0], Digits));
   FileClose(h);   
   return(0);
  }

As a result, we have:

(red circle - it takes the price as a date and this is very inconvenient for further work)

 

And this is a problem with your Excel settings. And don't blame the Expert Advisor, look up the file in Notepad and it's fine.

I've been struggling with the 2007 set, but have not been able to conquer this problem completely. The only way out: for Excel to see your data as numeric values, add "+" before the positive numbers, and with negative numbers, and so it is clear.

 
Already apologised to my MT4)) Checked the txt, it shows everything, thanks, otherwise I would have sat and poked around. Do you know if it is possible to replicate, namely, to upload data on EURUSD and USDJPY???
Reason: