Questions from Beginners MQL5 MT5 MetaTrader 5 - page 997
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Greetings fellow programmers. I need your help. The Expert Advisor opens only one deal on the first trading day of a month. It may be the first or the second or the third or even the fourth day. My condition is like this: if(Day == 1 || Day == 2 || Day == 3 || Day == 4 ){trade is opened} I want to ask if there is any function in MQL5 that would "tell EA that today is the first trading day of month"?
Greetings fellow programmers. I need your help. My Expert Advisor opens only one order on the first trading day of a month, and it may be the first or the second, the third or even the fourth day. My condition is like this: if(Day == 1 || Day == 2 || Day == 3 || Day == 4 ){trade is opened} I want to ask if there is any function in MQL5 that would "tell EA that today is the first trading day of month"?
You can't find the first trading day or you can't check the date of the current day with the first trading day of the month?
This is how you can find out more accurately the opening date of the month in the current TF(PERIOD_CURRENT can of course be changed to any day, for example).
But it is better to check each functioniTime,Bars.
Greetings fellow programmers. I need your help. My Expert Advisor opens only one deal on the first trading day of a month. But it may be the first or the second, the third or even the fourth day. My condition is like this: if(Day == 1 || Day == 2 || Day == 3 || Day == 4 ){trade is opened} I want to ask if there is any function in MQL5 that would "tell EA that today is the first trading day of month"?
Find where the opening of a new bar is discussed and substitute the period PERIOD_MN1 there
The opening of a new bar will be the first trading day of the month.
Can't identify the first trading day or can't check the current day's date with the first trading day of the month?
I cannot determine the first trading day of the month. Thank you for your recommendations I will experiment)
Find where the opening of a new bar is discussed and substitute the period PERIOD_MN1
The opening of the new bar will be the first trading day of the month.
Thank you. I will experiment in this direction as well)
Why do the authors use colons for writing? The code below is simply full of colons. Although the same::Sleep(5); can be written without colons?
Why do the authors use colons for writing? The code below is simply full of colons. But can we write the same::Sleep(5); without colons?
Operation context resolution ( :: )
Each function in mql5-program has its own execution context. For example, the system function Print() is executed in the global context. The imported functions are called in the context of the corresponding import. Functions-methods of classes have the context of the corresponding class. The syntax of the context resolution operation:
[context_name]::function_name(parameters)
If there is no context name, it is an explicit reference to use a global context. If there is no context resolution operation, the function is searched for in the nearest context. If the function is not in the local context, it is searched in the global context.
Also, the context resolution operation is used to determine the member function of a class.
type Class_name::function_name(description_parameters)
{
// function body
}
If a program uses or may in the future use several functions of the same name from different execution contexts, ambiguity may occur. The order in which functions are called without explicitly specifying the context:
To eliminate the ambiguity of a function call, explicitly specify the scope using the context resolution operation.
Context resolution operation ( ::: )
I take it the author is speeding up code processing. Well done.
The trading history is drawn on the chart, how do I disable this drawing?
The trading history is drawn on the chart, how can I disable such drawing?
Service - Settings - Trading - "Show trades on the chart in real time".