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
I did, long instead of int. Same problem. PrintFormat accepts %d for long also, according help. checked also %i %x.
Still returns 0.
Just as a simplified test, use the following in the OnCalculate (not tested or compiled, just written out):
And then show Experts log of outputJust as a simplified test, use the following in the OnCalculate (not tested or compiled, just written out):
And then show Experts log of outputThis works
Questions.
1. Is this documented ?
2. Why keeps it failing. OnCalculate is called with each tick ?
Thank you
Questions.
1. Is this documented ?
2. Why keeps it failing. OnCalculate is called with each tick ?
1. What specifically do you mean by "Is this Documented"?
2. Mine worked, yours did not! Something is wrong in your code.
Please have a look on the code above and on the log i attached. You can see a rates total > 0 and the call of
stil failing.
I thank you for your help but the use of SeriesInfoInteger is non intuitive here and behaves very unexpected.
1. What specifically do you mean by "Is this Documented"?
2. Mine worked, yours did not! Something is wrong in your code.
No, i think, my code should work without making a big thread here. This is my opinion. Your code works, yes, thank you, but why this special coding needed at all ?
This is what i mean by documented.
stil failing.
I thank you for your help but the use of SeriesInfoInteger is non intuitive here and behaves very unexpected.
Wrong:
Correct:
Also, why do you need that extra code when the data is already available to you within the OnCalculate?
It has "rates_total" which is the total number of bars (i.e.SERIES_BARS_COUNT).
It already has all the data for time[], open[], high[], low[], close[], tick_volume[], volume[], spread[] and there is no need to use CopyRates?
You are making your own programming difficult when the data it is already there and easily accessible.
EDIT: Yes it is all documented, but you are not following the documentation. That is why you are having this difficult time!
Wrong:
Correct:
Also, why do you need that extra code when the data is already available to you within the OnCalculate?
It has "rates_total" which is the total number of bars (i.e.SERIES_BARS_COUNT).
It already has all the data for time[], open[], high[], low[], close[], tick_volume[], volume[], spread[] and there is no need to use CopyRates?
You are making your own programming difficult when the data it is already there and easily accessible.
EDIT: Yes it is all documented, but you are not following the documentation. That is why you are having this difficult time!
Sorry
Is a mistake by me. But you can see in my original code it is correct, even it uses int as i guess there is an implicit cast.
You say:
"Also, why do you need that extra code when the data is already available to you within the OnCalculate?
It has "rates_total" which is the total number of bars (i.e.SERIES_BARS_COUNT).
It already has all the data for time[], open[], high[], low[], close[], tick_volume[], volume[], spread[] and there is no need to use CopyRates?
You are making your own programming difficult when the data it is already there and easily accessible.
EDIT: Yes it is all documented, but you are not following the documentation. That is why you are having this difficult time!"
I think this is not the point. There is a function, promising a service and this function works not reliable in OnInit and in OnCalculate only with your code.
This takes time.
I checked again the call in OnInit and it works now! Why that ?? Also with integer type.