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

 
Vinin:


You must open the file for reading/writing

Move the cursor to the end of the file before writing.

Do you mean move the cursor to the end of the file? I noticed that it blinks at the beginning of the line when writing.

But how can this be done? I haven't found it in a set of standard commands and functions? Thank you.

 
Fox_RM:

Do you mean move the cursor to the end of the file? I noticed that it blinks at the beginning of the line when writing.

How can this be done? I haven't found it in a set of standard commands and functions? Thank you.

https://docs.mql4.com/ru/files/FileSeek
 
 
Can you tell me how to correctly pass the time to the iBarShift function? I'm interested in bars that have a time of 00:00 hours.
 
Fox_RM:
Can you tell me how to correctly pass the time to the iBarShift function? I'm interested in bars which correspond to 00:00 hours.

iTime(NULL, PERIOD_D1,i); // where i is the desired day
 
Can you tell me how to correctly select a single open position using OrderSelect in order to then OrderModify it?
 
LuckyStrike:
Can you tell me how to correctly select a single open position using OrderSelect in order to then OrderModify it?
If(OrderSelect(OrdersTotal()-1, SELECT_BY_POS, MODE_TRADES))
  {
   OrderModify(...);
  }
 

Doesn't seem to want to, gives error 138( Trying to trailing)

int start()
 {
    if (OrdersTotal()==0 && Open>Bid)
      OrderSend (Symbol(),OP_SELL,Lots,Ask,3,Bid+150*Point,Bid-150*Point,0,Red);
      
         if(OrderSelect(OrdersTotal()-1, SELECT_BY_POS, MODE_TRADES))
           if (Bid-(Bid+150*Point)<-150)
          {
            OrderModify(OrderTicket(),OrderOpenPrice(),Bid+150*Point,Bid-150*Point,0,Red);
          }
 }
 
Vinin:

iTime(NULL, PERIOD_D1,i); // where i is needed day

Yes, that's exactly the problem, I don't know how to do a day or hour sweep. PERIOD_D1 will select a new day, but how to extract the time?

I also tried a specific time to do assignment D'00:00:00', in the directory says that you can, but somehow it did not work?

 
alsu:
Your broker probably has a limited time to use the demo account. Register a new one.
Thank you, I guess you are right, the EA and the account are working properly again.
Reason: