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
Thanks a lot Petr, this code do the job. I hope you can explain this lines in more details.
My former code doesn't watch if the parameter MaxCandles is greater than number of bars. It could cause error. I've updated the code to avoid that.
The code sets all the new candles (those weren't set to close before) to close (the first loop) and all the old candles (those weren't set to zero before) to zero (they aren't drawn) (the second loop). "Old candles" are candles those are to the left from count of number of MaxCandles candles. My explanation is really strange but if you watch the code it must be clear.
The rest of code is the same.
My former code doesn't watch if the parameter MaxCandles is greater than number of bars. It could cause error. I've updated the code to avoid that.
The code sets all the new candles (those weren't set to close before) to close (the first loop) and all the old candles (those weren't set to zero before) to zero (they aren't drawn) (the second loop). "Old candles" are candles those are to the left from count of number of MaxCandles candles. My explanation is really strange but if you watch the code it must be clear.
The rest of code is the same.