Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 555

 
Igroc33:
I've got a lot of smart guys to build, so are we going to play catch or are we going to get busy?
So it is business that needs to be done. Or do you need to hastily create, and then heroically fight with a poorly planned concept originally? Or you, calling me a wise guy, do you think I'm bullshitting and trolling you trying to know the amount of information you're putting in? Does it matter that a lot depends on it in the very concept of building logic and code?
I don't like rushing mindless people, I'm sorry, but - now yourself.
 
Alexey Viktorov:

Don't be rude, smart-ass. You are being asked the right questions. How do you imagine such an indicator would work? You enter the data, it's counted. You forget to enter it, the hell with it, we won't count it... Right?

What do you mean you forgot to enter? Are you guys playing games or just let's talk about distractions?
 
Igroc33:
If I had imagined it, I would not have come to you, smart guy. What do you mean you forgot to enter the game or you just want to talk about distractions?
You can't even articulate what you want. Hence the lack of understanding of the need for questions. How are you going to write code then?
Or in the hope that the "smart guys" will do it for you?
Then you've got the wrong branch. Read its first post - it says what it is for.
 
Artyom Trishkin:
You can't even articulate what you want. Hence the misunderstanding of the necessity of the questions. How are you going to write code then?
Or in the hope that the "smart guys" will do it for you?
Then you've got the wrong branch. Read its first post - it says what it's for.
Let's not engage in preperations about how much such work will cost
 
Igroc33:
we will not engage in any prevarication as to how much such a job would cost
Write an application to Freelance. And choose a performer according to your needs and abilities.
 
Hi guys. A question has arisen. Other than this selection for(int i=0;i<OrdersTotal();i++) and for(int i=OrdersTotal()-1;i>=0;i--) is there nothing? If so, please advise which ones
 
Rustam Bikbulatov:
Hi guys. A question has arisen. Except for(int i=0;i<OrdersTotal();i++) and for(int i=OrdersTotal()-1;i>=0;i--) there is nothing? If so, please tell me which ones.

To choose from https://docs.mql4.com/ru/basis/operators

1 - https://docs.mql4.com/ru/basis/operators/while

2 - https://docs.mql4.com/ru/basis/operators/dowhile

If of the for variety, you could write like this

for(int i = OrdersTotal(); i-- > 0;)
Операторы - Основы языка - Справочник MQL4
Операторы - Основы языка - Справочник MQL4
  • docs.mql4.com
Операторы языка описывают некоторые алгоритмические действия, которые необходимо выполнить для решения задачи. Тело программы — это последовательность таких операторов. Идущие друг за другом операторы разделяются точкой с запятой. Выполняет оператор до тех пор, пока проверяемое выражение не станет ложным. Проверка условия окончания...
 
Alexey Viktorov:

To choose from https://docs.mql4.com/ru/basis/operators

1 - https://docs.mql4.com/ru/basis/operators/while

2 - https://docs.mql4.com/ru/basis/operators/dowhile

If of the varieties for, you can write like this

THANK YOU!

 

Do you guys know where to find or help me to fix trailing stop, which works this way:

For example, an BUY order with TP = 100 and SL = 200 was opened, and when the price went to BUY and passed 50 points, then SL became the opening price, while TP was moved to 50 points and so on constantly????

void TrailingPositions(int otype)
{

int cnt = OrdersTotal();

int lMinProfit = 0; // Min. pips

int lTrailingStop = 40; // Trailing position level (the number of points from the previous SL distance)

int lTrailingStep = 20; // Trailing stop level (the number of points after which it will trigger)

for (int i=0; i<cnt; i++)
{
if (!(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))) continue;
if (OrderSymbol() != Symbol()) continue;

if (OrderType() == OP_BUY && otype == OP_BUY) {
if (Bid-OrderOpenPrice() > lMinProfit*Point) {
if (OrderStopLoss() < Bid-(lTrailingStop+lTrailingStep-1)*Point) {
if(OrderModify(OrderTicket(), OrderOpenPrice(), Bid-lTrailingStop*Point, TP + lTrailingStop * Point, 0, Blue))
Print("Trailing Stop is working");
}
}
}

if (OrderType() == OP_SELL && otype == OP_SELL) {
if (OrderOpenPrice()-Ask > lMinProfit*Point) {
if(OrderStopLoss() > Ask+(lTrailingStop+lTrailingStep-1)*Point || OrderStopLoss() == 0) {
if(OrderModify(OrderTicket(), OrderOpenPrice(), Ask+lTrailingStop*Point, TP - lTrailingStop * Point, 0, Red))
Print("Trailing Stop is working");
}
}
}
}
}
 

How do I get the CPU ID?

I'm defending, I got the HDD ID, but I can't find the CPU ID :(