Questions from Beginners MQL4 MT4 MetaTrader 4 - page 105

 
Andrei: Is there any way to set up a chart to open with the correct timeframe on the open button? Thank you

Do you mean these buttons?

 
STARIJ:

You mean these buttons?

No. The button to open a closed chart either with the mouse from the list on the left...

 
Leon:
Greetings!
Can you tell me how to delete a pending order on a previous candlestick if I need to reopen the pending order on a new one?
A new bar is defined as
I place the pending order like this
Can it be like this? Well, how to close in a past moment that has already passed in the past
static datetime New_Time=0;                  // Время текущего бара
New_Bar=false;                               // Нового бара нет
if(New_Time!=Time[0])                        // Сравниваем время
{
   New_Time=Time[0];                         // Теперь время такое
   Closer();
   OrderSend(Symbol(),OP_BUYSTOP,NormalizeDouble(Lotpers,5),Ask+OrderStep*Point,100,0,0,NULL,MagicNumber,0,clrNavy);
}

void Closer()
{
    Тут разные проверки наличия и закрытие
}
 
Andrei: No. The button to open a closed chart either by mouse from the list on the left...

draw a screenshot. With the mouse to the left of what?

 
STARIJ:

draw a screenshot

Well the chart button with the plus sign on the left corner....
 
Andrei Well the chart button with the plus sign in the left corner....

if this button is - I removed it long ago and forgot about it. And the plus sign is in the middle rather than in the left corner

 
Andrei:

No. The button to open a closed chart either by mouse from the list on the left...


And such a beauty, no?

 
Andrei:

Is there any way to set up a chart to open with the required timeframe on the open button? Thanks

Try the following.

Open the right chart with the right TF. Configure it the way you want. Save it in a default template

 

STARIJ:
Может быть так? Ну как закрыть в прошлый момент, который уже прошел в прошлое

Thank you, it worked!

 

1. How do I close a position with a pending order? I couldn't find any special tools in the documentation. So, only by counter order and then OrderCloseBy()?

2. How do I know the error that occurred when triggering a pending order, e.g. NOT_ENOUGH_MONEY? There is nothing in LastError(). But it is there and the tester displays it in the log.

Reason: