[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 870

 
fanat:

I've moved it. But that didn't solve the problem. It's still the same.

Show me the EA code!

 
fanat:

Should it be sent in two parts?
Or maybe just attach the file? It's to the left of add a comment
 
Rossi:

Thank you very much... I was afraid everyone would press a few keys to answer...
Don't you know anything about terminals? What's that got to do with everyone being afraid to answer? And you were probably afraid (or unwilling) to type in what you wanted to find... But you're the one who's to blame. It's a mess...
 
wiwkin52:
Hello. How can I see the indicator readings from a higher timeframe? What i have in my indicator settings are 21 and 5 on H1 multiplied by 4 and i get H4 readings on H1. Since I work with 15 min timeframe I need to see H1 readings on M15. What settings does the indicator need to be set?


A lot of information in your question, let me ask you:

read https://docs.mql4.com/ru/indicators/iCustom

Or do you need something else? If the bars are from another TF iBars, iClose ...

 
IgorM:


a lot of information in your question, let me ask you:

read https://docs.mql4.com/ru/indicators/iCustom

or do you need something else? if the bars are from another TF iBars, iClose ...


no thanks) got it sorted out)
 

Gentlemen, please advise, we need to do something like this in EA :

If the file http://anysite.com/anyfile.txt (extension doesn't matter) - exists (opens, or server response 200, in general any fact of its existence on the Internet) then ...

otherwise ...

Is there any such command in mql language? I would be grateful for at least some similar example and the simplest solution.

The idea is the following: if there is a file on the net, the Expert Advisor works, if there is no file, the Expert Advisor does not work. The Expert Advisor checks the file on the network before every opening / closing of a position. This is needed as insurance against force majeure cases :) in order to immobilize the Expert Advisor in case of violation of the agreements.

 

Gentlemen, here's a question:

How to pull out, for example, the last 100 orders from the trade history. And exactly in the order in which they were closed?

Thank you.

 
Bicus:

Gentlemen, here's a question:

How to pull out, for example, the last 100 orders from the trade history. And exactly in the order in which they were closed?

Thank you.

double history(){
int time = 0;double profit = 0;//обьявляем необходимые нам переменные куда мы положим интересующие нас характеристики ордера
for(int i = OrdersHistoryTotal();i>=0;i--){// Перебираем все закрытые ордера
  if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)){//если ордер с таким номером (i) в списке закрытых ордеров есть ( не путать с тикетом)
    if(OrderSymbol() == Symbol()){//если выбранный ордер был открыт по нашей валютной паре
      if(time<OrderCloseTime()){//(сравниваем его с хранящимся в пероеменной time) 
        time=OrderCloseTime();//если время закрытия ордера больше - ложим его в переменную
        profit=OrderProfit();//и заодно запоминаем прибыль ордера
      }
    }
  }
}
//по окончании этой процедуры в наших переменных будут сидет наибольшее время закрытия, и его профит. Или по нулям если история чистая.
//теперь мы можем выставлять условия в зависимости от результата процедуры
   
if(profit == 0 &&time == 0){//действия если история чистая}

}
if(profit >= 0){//действия если последний ордер был прибыльным, или нулевым}

}
if(profit <  0 ){//действия если последний ордер был убыточным}

}
return(0);
}

can you build what you need from this code yourself? the code is not mine -Xrust, but it's very well done
 
IgorM:

This code is not mine -Xrust, but very well done


Thanks, of course. But with brute force I already have it. It takes too long and the optimizer gets bogged down in very time-consuming calculations.

I was thinking that you could somehow clamp the tickets of the last operation with orders into an array, for example. Is it possible? Or, is it possible to do nothing but brute force?

 
Bicus:

Gentlemen, here's a question:

How to pull out, for example, the last 100 orders from the trade history. And exactly in the order in which they were closed?

Thank you.


When you close a position, put them in a separate array with all the data you need, and then go through it...
Reason: