[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 524

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. That helped. Thought it was only the iMac*** iStoch*** indicators that came preinstalled.
Dear experts, isn't there an error in the textbook?
Here is my reasoning:
At the beginning of the code,int ArrayCopyRates function is called which copies the data of the bars of the current chart into a two-dimensional array of RateInfo[][6] type and returns the number of copied bars or -1 in case of failure according to the example of this function:
the current bar is the bar with index 0-0 , thus, returning to the original code, we copy the element with index 0-0 (the current bar) of array1 , to array2 with index 0-0, we get the last 10 bars (where the last bar is the current bar, the one with index [0]), which is contrary to what we wrote in the tutorial... and respectively, by copying element with index Bars*6-60,60 of array1 into array2 with start index of element 0 we get information about bars from history.
Without making loud statements, let's check it in practice:
Without making high-profile claims, let's put it to the test:
Yes, in practice it does indeed turn out that the element with index Bars*6-60,60 is the current bar... then how do you explain that in the example :
The current bar is array1[0][0] and after copying the array it becomes array1[Bars*6-60,60][0]... it turns out that somewhere there is renumbering... Of course, the result is clear after using the function in practice... but the logic is messed up, in my opinion)))Yes, in practice it does turn out that the element with index Bars*6-60,60 is the current bar ...
This is your conclusion.
Without making high-profile claims, let's put it to the test:
So here is a specific element of theTimeToStr(array2[a][0]) array.
That the output is correct, I agree. But what does Bars*6-60 have to do with it? What value is substituted for Bar during calculation? If bars, how do you get the last 10 bars?
You may notice, I am not the only one who did not understand this on the forum, but many people did.
It turns out that the number of all bars multiplied by 6 and minus 60. Where did we get 6 from ? It doesn't make any sense at all.
So here is a specific element of theTimeToStr(array2[a][0]) array.
The output is correct, I agree. But what does Bars*6-60 have to do... What value is substituted for Bar during calculation? If bars, how do you get the last 10 bars?
As you may notice, I'm not the only one who hasn't understood it on the forum, many others haven't.
int Bars -- Number of bars on the current chart.
It turns out that the number of all bars multiplied by 6 and minus 60. Where did we get 6 from? It doesn't make any sense at all.
int Bars -- Number of bars on the current chart.
Well, where did the last 10 come from then?
int Bars = 10 000;
Then Bars*6 - 60 = 10 000*6 - 60 = 60 000 - 60 = 59 960;
The value of59 960 is greater than the value of Bars. And it already means that it is outside the array. And 10 is nowhere to be traced...
It turns out that the number of all bars multiplied by 6 and minus 60. Where did we get 6 from? It doesn't make any sense at all.
Well, where did the last 10 come from then?
int Bars = 10,000;
Then Bars*6 - 60 = 10 000*6 - 60 = 60 000 - 60 = 59 960 -- error!!!
The value of59 960 is greater than the value of Bars. And this already means that it has gone beyond the array's limits. And 10 is nowhere to be seen.
Victor, don't worry, you'll get there. "Experience is the son of hard mistakes..." Go from the simple to the complex, not the other way around:
"PROGRESS (from lat. progressus - movement forward), a direction of development characterized by a transition from the inferior to the superior, from the less perfect to the more perfect. Progress can be spoken of in relation to the system as a whole, its individual elements, the structure of the developing object. The concept of progress is the opposite of the concept of regress.
REGRESS (from Latin regressus - reverse movement), the type of development, which is characterized by the transition from higher to lower. The opposite of progress."