Questions from Beginners MQL4 MT4 MetaTrader 4

Vladimir Karputov  
If you have questions about MQL4, MT4, MetaTrader 4, please post in this thread. Especially when your questions are related to trading functions.
Vitalie Postolache  
If possible, attach a topic so it doesn't get lost.
Vladimir Karputov  
Vitalie Postolache:
If possible, attach the topic so it doesn't get lost.

The topic is attached. You can see it like this:

first click on the section name:

click on a section title

then you can see that the topic is at the very top:

topic attached

But: if there are more recent posts in other threads, the thread will of course go down.

Vitalie Postolache  
Vladimir Karputov:

But: if there are more recent posts in other threads, the thread will of course go down.

Can't the forum engine allow a topic to be permanently at the top, among the pinned ones?

Because I've noticed that "pinned" topics slide down on the main page, they're only at the top when you go to the right section.
Vladimir Karputov  
Vitalie Postolache:

Can't the forum engine allow you to pin a topic so that it's always at the top of the pinned ones?

Because I've noticed that "pinned" topics slide down on the main page, they're only at the top when you go to the right section.
Yes. It's the forum engine. You can only see an attached topic (even if it has slid to the basement) by clicking on the section name.
Vladimir Karputov  

Forum on trading, automated trading systems and trading strategy testing

Questions from Beginners

Nickolay72, 2016.11.08 10:04

I need to know why take profit modification does not work, when i pre-specified SL and TP, DT gives out an error 130:

-Buy condition-

{
  Ticket=OrderSend(NULL,OP_BUY,Lot,Ask,slippage,0,0,NULL,magic,0,Blue);
  if(!Ticket>0)Print(GetLastError());
  else
  TP=NormalizeDouble(Bid+TakeProfit*Point,Digits);
  bool modify=OrderModify(OrderTicket(),OrderOpenPrice(),TP,0,0);
   return;
}

-selling conditions-

{
  Ticket=OrderSend(NULL,OP_SELL,Lot,Bid,slippage,0,0,NULL,magic,0,Red);
  if(!Ticket>0)Print(GetLastError());
  else
  TP=NormalizeDouble(Ask-TakeProfit*Point,Digits);
  bool modify=OrderModify(OrderTicket(),OrderOpenPrice(),TP,0,0);
   return;
}

What is wrong?


Roma Korobeynikov  
K_i_r_i_t_o:
Hello, can you please help me with advice about one condition that I need the EA to work once a day, in general I need if(the condition) {every day a pending order is placed at the same time} maybe there is a simple solution that does not come to mind =/ EA or script in any form

can take the value of 0 bar open time with period D1, + add the number of seconds,

in the condition to compare the current time with the obtained time in the first line

In a pending order you can set the number of seconds, the life time of the order.

Data_1=iTime(Symbol(),PERIOD_D1,0)+86400;  //время жизни ордера
Reason: