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
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 further extension of the task
It seems to me that this is not a good example to demonstrate the usefulness of OOP.
Here, for example, is a variant using only one function:
you can of course remove it fromOnTick and insert it intoOnTimer
About this question, I think you are wrong. Please check with Service Desk. Let them answer the question: whether new bars are formed in the platform regardless of the arrival of quotes, or not. If no, then on the event of a new bar check whether there was a quote on it. If it was, the new bar has been formed. We can do it this way. You don't need to change much.
It seems to me that this is not a good example to demonstrate the usefulness of OOP.
Here is, for instance, a variant using only one function:
you can, of course, remove it fromOnTick and insert it intoOnTimer
Didn't look at the logic, well let's assume that hypothetically it works correctly.
And by any random characters?
Imagine that the program uses a list of symbols from the Market Overview window, and the user can change the symbol sets at any time.
Respectfully.
Artyom is a little bit behind on his question, but the question is this: write it in procedural style so that it works correctly
Yes on a timer. A new bar appears without a quote. We are interested exactly in the event of bar appearance, while we can fix the quote in Optisk();
A bar will appear in any case.
Here we have the explanation of bars:
Time[i] bar open time is usually not the same as the tick arrival time. The opening time of a bar for any timeframe is always a multiple of the timeframe. Any first tick occurring within the timeframe is a bar forming one; if no tick has arrived within the timeframe, no bar will be formed within this timeframe either.
Artyom didn't really cover the question, but the question is this: write it in procedural style, so that it works correctly
I wanted to gradually add tasks to make it fast, convenient, easy and simple for people to implement the task. To show later how it is easily done using OOP.
But the main rejector of OOP himself turned away from the solution of the problem :)
I wanted to gradually add tasks to make it fast, convenient, easy and simple for people to implement the task. To show then how easy it is to do it with OOP.
But the main rejector of OOP himself has rejected the solution of the task :)
Yes I didn't exactly state it myself, I'll paraphrase:
Artem has not opened a little the question, and the question is this: to write in procedural style that it works correctly
Maybe he will come back and prove that it is very easy and simple
I didn't really say it myself, so I'll rephrase it:
Artyom didn't really cover the question, and the question is this: write in procedural style, so that it works correctly
Maybe he will come back and prove that it is very easy and simple.
I had a goal of getting his procedural style code to work in such a loop in the end:
I had the goal that the end result would be that his procedural style code would work in such a loop:
Symbol loop, checking for a new bar opening on the arrival of a quote and so on, could easily be added to my solution. And what does OOP have to do with it?
You have chosen a wrong example. Think about something else at your leisure.