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
Thank you all very much for your help and participation!!!
Versions 1,2 and 4 are more correct, but have errors, somewhere it is correct (day to day) and somewhere it is missing 2-3 days
Version 3 sees the number of bars for the period that have already been calculated.
Although it counts 1, 2 and 4 correctly.
I didn't take into account that the second point then moves to the received +n bars
and there are also weekends and as a result I am 2-3 bars short to the right place
Is it possible to identify the visible bars?
I.e. we have the first price and add the visible bars to it on the chart
. Otherwise we have the first point on the 5th of the month + 12 bars = the 17th of the month + 4 days off = the 21st of the month and we are missing a couple more days to the end point
Is it possible to identify exactly the visible bars?
Yes, no problem. And this particular answer was the very first in the thread. Simple, quick, elegant.
Including weekends?
Write 12 months, i.e. 12 variables with the number of days in them, all into an array
into an array of years, with the number of days in February, or calculate a year with a leap in February.
in a loop:
add up the full and remaining days in the start and end months of the required period
How do holidays get away? Or don't they count as holidays?)
It will calculate the total number of days and subtract the number of days in the quote history
You can if you can be sure that there are no other reasons for missing the day.
It is also possible to miss only part of the day - this can also have a negative impact on the calculations
It is also possible to skip only part of the day - this can also have a bad effect on the calculations
In this case the daily bar will still be present on the chart
You can if you can be sure that there are no other reasons for missing the day.
It is also possible to miss only part of the day - this can also have a negative impact on the calculations
in which case the daily bar will still be present on the chart
It will, of course. But, for example, its high-low will stand out from the rest and there will always be a question - is it a holiday or dropped minute bars? It is not very clear how to automate such checks.