Questions from Beginners MQL4 MT4 MetaTrader 4 - page 10

 
drone14:

Hello. I want to collect price statistics for certain time periods. Fix maximum/minimum prices in time intervals "from before". Problem with the implementation. The iHigh and iLow functions only work with predefined timeframes (1, 5, 15, 30...), while I need to take the timeframes I find convenient.

  • Can I specify my own timeframes in the iHigh and iLow functions? And if so, what should I do, for example, to take values from 10:00 to 15:00 every day? I think I should make a timeframe array and run it through a loop. If not, correct me.
  • Can the resulting prices be written to a file via FileOpen?
Thanks for the help.

Take the data from M1 and look at the selected interval, you won't be more accurate without a tick history anyway. Don't confuse the timeframe and the "from and to" timeframe, these are different things.

 
Downloaded version 636 on android but can't see list of brokers. Is the terminal version no longer supported?(( if it is, where can I get a working version?
 

Hello ... Please advise how you can add a new event to the list of existing events in MT4 > Tools > Settings > Events ... for example: Stop Loss.

Thank you for your informative reply.

 
bablusut:

Hello ... Please advise how you can add a new event to the list of existing events in MT4 > Tools > Settings > Events ... for example: Stop Loss.

Thank you for your very clear answer.

There is no way. Or rather, you can (edit \configuration/events.ini file in the hex editor), but the terminal will not understand what it is.

You can write an Expert Advisor that will play a sound, send a mail or a notification to a smartphone at the required "event".

 
Vitalie Postolache:

There's no way to do it there. Or rather, you can add (edit \configuration/events.ini file in hex editor), but the terminal will not understand what it is.

You can write an Expert Advisor that will play a sound, send a mail or a notification to a smartphone at the required "event".

Thanks for the reply ... And what code to add to the Expert Advisor, to get a Take Profit - one melody and Stop Loss - another ... any tips? I mean when an order is closed atTake Profit or Stop Loss.
 
Good time everyone. I have no such a good history and they offer to download metaquotes through ft2.
 
bablusut:
Thanks for the reply ... What code should I add to my EA to get a Take Profit to one tune and a Stop Loss to another ... any tips? I mean when an order is closed atTake Profit or Stop Loss.

First, the necessary melodies should be in the Sounds folder of the terminal. Second, you need to monitor the order closing by history and if there is a new order in the history - see if it was closed by the SL or TP. And depending on this, we will call the PlaySound() function with the necessary sound.

In general, there can be many variants, for example, if you have a batch of orders closed at once, maybe the logic should be different).

 
Mikhail Goryunov:
Good time everyone. I have a good feeling about the market situation and I'm sure it will change soon.

What is f2?

Generally, this can happen when you are downloading history from the MQ server and you are on a different server in real time. The history from different TFs in one time interval may not coincide. You can use my free product in the marketplace to get the history correct (if free products are also not allowed to advertise in any way - pardon, dear moderators).

 
Alexey Kozitsyn:

First, the necessary melodies should be in the Sounds folder of the terminal. Second, you need to monitor the order closing by history and if there is a new order in the history - see if it was closed by the SL or TP. And depending on this, we will call the PlaySound() function with the necessary sound.

And in general, there can be many variants, for example, if you have a bunch of orders closed at once, then perhaps the logic needs to be built differently).

Hello ... Thanks for the reply ... Maybe someone can help me write a function code in MQL4, or at least give me a link to the content with similar properties ... would be grateful ...
 
bablusut:
Hello ... Thanks for the reply ... Can someone help with writing a function code in MQL4, or at least a link to the content with similar properties ... I would be grateful .
https://docs.mql4.com/ru/trading/ordershistorytotal
OrdersHistoryTotal - Торговые функции - Справочник MQL4
OrdersHistoryTotal - Торговые функции - Справочник MQL4
  • docs.mql4.com
OrdersHistoryTotal - Торговые функции - Справочник MQL4