How to know which price series the user selected when the indicator is added to the chart ? - page 2
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 am sorry but I think I'm lazy.
That doesn't exactly connote a serious desire to be successful in the business of trading. Let's just say that you want to be "efficient" instead.
If only the prices starting at index "begin" are relevant, then why isn't the first "begin" prices of the array removed and the "rates_total" parameter adjusted ?
Whether you use the simple form of OnCalculate() or the long form of OnCalculate(), you still need to write a main loop to iterate through the bars of the chart:
I am sorry but I think I'm lazy. I will write the code that deals with the "begin" parameter of the simplified version of OnCalculate and then use it with every custom indicator. To me, this parameter is useless. If only the prices starting at index "begin" are relevant, then why isn't the first "begin" prices of the array removed and the "rates_total" parameter adjusted ?
I've just fallen into another trap. When a moving average has a non-zero time shift parameter, than its buffer is smaller. The following access causes an "array out of range error":
This one is ok:
When a moving average has a non-zero time shift parameter, than its buffer is smaller. The following access causes an "array out of range error"...