
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
The task is as follows: I need to make a function that will return the fact of opening a new bar. First on EURUSD M5.
Further the task will be extended.
I see.
Suppose the following function prototype will work: bool New_bar(int Timeframe = M1) ?
It means that a user calls the function and sends the ID of the desired timeframe to it. In response he gets true/false (a new bar opened or not)?
If this is what is needed, I will try to write it now.
I see. Got the wrong guy... You know how to pass a variable by reference, no doubt.
Now, for simplicity of writing in the code, if you need to determine the specified period and the current period. It turns out that you have to create variables for the current period as well, right?
I see.
Suppose this prototype function would work: bool New_bar(int Timeframe = M1) ?
That is, a user calls the function and passes to it the identifier of the desired timeframe. In response he gets true/false (a new bar opened or not)?
If that's what's needed, I'll try writing it now.
Just need to write a function that asks the user: "is there a new bar on M5?" and gets a yes/no answer.
For example:
Here is your function IsNewBar() and we will develop and twist/rotate it further with further extension of the task
You just need to write a function where the user asks: "is there a new bar on the M5?" and gets a yes/no answer.
For example:
Here is your function IsNewBar() and we will develop and twist/rotate it further with a further extension of the task
I see.
Suppose this prototype function would work: bool New_bar(int Timeframe = M1) ?
That is, a user calls the function and passes to it the identifier of the desired timeframe. In response he gets true/false (a new bar opened or not)?
If this is what you need, I'll try to write it now.
A tip from a self-taught trainee:
To ease the migration to mql5, it would be better to use not int period variables in mql4, but from the enum ENUM_TIMEFRAMES.
Got it. Good. Give me some time, I'll write up the code. Only in Russian. It's more familiar.
Even better. It's easier for Russians and Russian speakers to understand.
... Inheritance and polymorphism...
I gladly believe that your problems cannot be solved without them. You have to go into details to believe it :)
You just need to write a function that asks the user: "is there a new bar on M5?" and get a yes/no answer.
For example:
Here is your function IsNewBar() and we will develop and twist/rotate it further with further extension of the task
Spin
this is going to be a bit of an off-topic to the conversation.
I was just peeling potatoes and a thought occurred to me
if there are developers and programmers here, why not do it on µl
- a self-sufficient file with its own interface that runs the terminal, skype and another terminal
- on the mt4(5) terminal putting a bot from a selected list of 3 (drop-down menu)
...
Spin
Spin it. Terrible brakes.
this is going to be a bit of an off-topic to the conversation.
I was just peeling potatoes and a thought occurred to me
if there are developers and programmers here, why not do it on µl
- a self-sufficient file with its own interface that runs the terminal, skype and another terminal
- on the MT4(5) terminal put a bot from a list of 3 selected (drop-down menu)
Why?