//--------------------------------------------------------------------// newbar.mq4 // Предназначен для использования в качестве примера в учебнике MQL4.//--------------------------------------------------------------------bool New_Bar=false; // Флаг нового бара//--------------------------------------------------------------------int start() // Спец. функция start
{
//--------------------------------------------------------------------
Fun_New_Bar(); // Обращение к ф-ииif (New_Bar) // Новый бар
{
//Ваши действия
}
return; // Выход из start()
}
//--------------------------------------------------------------------void Fun_New_Bar() // Ф-ия обнаружения ..
{ // .. нового бараstaticdatetime New_Time=0; // Время текущего бара
New_Bar=false; // Нового бара нетif(New_Time!=Time[0]) // Сравниваем время
{
New_Time=Time[0]; // Теперь время такое
New_Bar=true; // Поймался новый бар
}
}
//--------------------------------------------------------------------
Good afternoon. How can I calculate a single Stop Loss for a series of orders with exact magic numbers so that this series of orders can close at breakeven. For example, there are 3 orders: 1 Buy lot 1.3320 with magic 1, 1 Buy lot 1.3345 with magic 2 and 1 Buy lot 1.3360 with magic 3. How do I calculate the total Stop Loss for all orders, so that when the order moves against the price it closes at breakeven?
to exit a position after the bar at which the position was opened. I have a problem now: I want to exit after two bars after the signal. Can you please explain the problem?
}
here's a tribute or tribute to the odmins, I don't know why he needs it
but please help me write some lines of code
condition when you open a new bar to display an alert new bar
I don't need to count them no need to multiply them no need to divide them no need such complicated code
Read the textbook.
greatest thanks to the honour of honour and gratitude
I've honestly been looking all day.
could you please add this line to it so that it closes orders only with a certain magician
could you please add this line to it so that it closes orders only with a certain magician
I CERTAINLY COULD HAVE GUESSED IT MYSELF...
THANK YOU SO MUCH.
Guys, help me close the code, how to do it please
tell me where to get the info!!!!!
Guys, help me close the code, how to do it please
tell me where to get the info!!!!!
If you have written the code then you can put restrictions on it yourself.
Dear Gurus! I've encountered a problem with the EA looping. I have added the variable "t" to the code,
to exit a position after the bar at which the position was opened. I have a problem now: I want to exit after two bars after the signal. Can you please explain the problem?