Questions from Beginners MQL5 MT5 MetaTrader 5 - page 371

 
Artyom Trishkin:

Oh, man... Perfect timing.

Although yes ... and I was dumb enough to send him a lame-ass private message.

Oh, well... It's been written, read, and eaten.

And this is for others who also don't know how to write a PM ;)
 
Can you tell me how to find and select the first bar of the day?
 
sashasonik:
Can you tell me how to find the first bar of the day?
   datetime day = iTime(Symbol(), PERIOD_D1,iBarShift(Symbol(), PERIOD_D1, iTime(Symbol(),PERIOD_H1,0)));
   int Bar = iBarShift(Symbol(), PERIOD_H1, day);   // Бар, соответсвующий началу суток
It looks like this, roughly.
 
Vitalii Ananev:
I think that's about it, roughly.
Thanks, I'll give it a try.
 
sashasonik:
Thank you, I will give it a try.
Vitalii Ananev:
It looks like this, approximately.
To be more precise, on any timeframe.
 
sashasonik:
More precisely, to be on any timeframe.
int bar=iBarShift(Symbol(),Period(),iTime(Symbol(),PERIOD_D1,0));
 
Artyom Trishkin:

Everything works, thank you!

 

Greetings all!

Can you tell me how to get a list of symbols in the symbol window in MarketWatch?

So that they can then be searched in a loop.

If there is a piece of code, generally good :-)

Thanks in advance!

 
Aleksey Masterov:

Greetings all!

Can you tell me how to get a list of symbols in the symbol window in MarketWatch?

So that they can then be searched in a loop.

If there is a piece of code, generally good :-)

Thanks in advance!


SymbolsTotal()

Returns the number of available (either selected in MarketWatch or all) symbols.

intSymbolsTotal(
bool selected// true - only symbols in MarketWatch
);

Parameters

selected

[Request mode. Can take values true or false.

Returned value

If selected is true, the number of characters selected in MarketWatch is returned. If false, then the total number of all symbols is returned.


Try it in the loop.

for(int i=0; i<SymbolsTotal(); i++) {}

And what you are looking for - only you know

 

question to mt4 experts

A trader places a pending order and closes it before it is activated. After a week he sees this order open and triggered.

The question is whether it is technically possible for the broker to open a remote pending order (e.g. to close someone's account).

The situation is real - there were no reports sent to the mail. The broker's server logs and account logs have been switched off.

The broker's server logs and trader's mt4 logs are different - by the time of opening a disputed order.

Reason: