Questions from Beginners MQL5 MT5 MetaTrader 5 - page 805

 
Vladimir Karputov:

You can't. You have to sign up from a Windows desktop computer, and MetaTrader 5 must be installed on that computer.

I see, thank you.
 
DCodec:

I can't solve a simple problem.

In the EA, when getting the indicator handle...

int OnInit()
  {
//--- Получить хэндл индикатора Envelopes_upper для отрисовки верхней линии
   EnvHandle_upper=iEnvelopes(NULL,0,Period_upper,0,MODE_SMA,PRICE_MEDIAN,Deviation_upper);

....terminal draws both lines, but I only need the top line.

How to disable drawing of this line? I.e. change its colour to CLR_NONE, or line style to DRAW_DONE?

I understand that my question stumped everyone: either because it is too simple or it is impossible?

 
Question about OnBookEvent().


The init made a subscription to the euroyoungest. But OnBookEvent() never worked. In help it says: BookEvent event is generated... when the state of the price stack changes.

Please explain in a nutshell: what is meant by "change of state"? If it's a quote, then it's always moving. If not, then what?

 

Greetings all! searched the forum for 30 minutes for"new bar", I was sad to find that the search on the forum works in its own way...

If i'm interested, what is the latest build of mql5 in terms of finding a new bar for the indicator that works on one timeframe, what code anyone uses now?

ZS: i searchedTimeframesFlags ... it's a cumbersome solution, but universal

thanks in advance!

 
User_mt5:
Question regarding OnBookEvent().


The init made a subscription to the euroyoungest. But OnBookEvent() never worked. In help it says: BookEvent event is generated... when the state of the price stack changes.

Please explain in a nutshell: what is meant by "change of state"? If it's a quote, then it's always moving. If not, then what?

BookEvent is used for exchange instrumentsthat have a Depth of Market.

And for currencies - you need to use the MarketWatch function.

 
Ivan Ivanov:

BookEvent is used for exchange instrumentswhich have Depth of Market.

For currencies, the MarketWatch function should be used.

Thanks for the reply, I will look into it.
Actually, I need a function, which would be called on the tick of any symbol (not just one, but all of them). Can you tell me how to do it?
 
User_mt5:
Thanks for the reply, I will look into it.
Actually, I need a function which would call on the tick of any symbol (not just one, but all of them). Can you tell me how to do it?

In principle, OnTick() does this , but be aware of it:

NewTick

The NewTickevent is generated when new quotes arrive and is handled by the OnTick() function in attached EAs. If at the arrival of a new quote the OnTick function was running on the previous quote, the incoming quote will be ignored by the Expert Advisor, because the corresponding event is not placed in the EA event queue.

All new quotes that come during the execution of the program are ignored by the program until the next execution of the OnTick() function is finished. The function will be launched only after the next new quote has been received.

 
Ivan Ivanov:

Basically, OnTick() does it.

I probably don't even have the brains to ask the question correctly.

I need such a function, which would be triggered in response to a tick on any character. There is only one expert. It sits, for example, in the euro window. However, the ticks come to the pound, the franc and gold. This expert in the euro window must rise to any tick - both pound and franc. We are talking about a multi-currency EA.

OnTick works properly, but it only rises on euro ticks.

I'm beginning to realise that just this simple issue isn't solved. There needs to be some kind of euro tick emulator or something. The timer, unfortunately, at least for 1 second. And I don't want to get hung up, because then there are a lot of questions - and when switching the TF and when catching the keyboard, etc.

 
User_mt5:

I guess my brain isn't even big enough to ask the right question.

I need a function that triggers in response to a tick on any character. There is only one expert. For example, it sits in the euro window. The ticks come to the pound, the franc and gold. This expert in the euro window must rise to any tick - both pound and franc. We are talking about a multi-currency EA.

OnTick works properly, but it is raised only on euro ticks.

I'm starting to realise that just this simple issue isn't solved. Need some kind of euro tick emulator or something. Timer, unfortunately, at least for 1 second. And I don't want to loop, because then a lot of questions arise - both when switching the TF and when catching the keyboard, etc.

EventSetMillisecondTimer

Документация по MQL5: Работа с событиями / EventSetMillisecondTimer
Документация по MQL5: Работа с событиями / EventSetMillisecondTimer
  • www.mql5.com
Указывает клиентскому терминалу, что для данного эксперта или индикатора необходимо генерировать события таймера с периодичностью менее одной секунды. нужно получать события таймера чаще, чем один раз в секунду. Если вам достаточно обычного таймера с периодом более 1 секунды, то используйте EventSetTimer(). В тестере стратегий используется...
 
Vitaly Muzichenko:

EventSetMillisecondTimer

(Vitaly, Vitaly!))
You have no idea how grateful I am to you!

That's a lot to take in. Of course, everything needs to be tried out now, but that's the little things.

I had no idea that happiness can be so close!)) Thank you! How is it... I'm here for you, I'm here for you!