When I loaded the indicator on a chart with no other indicators present, it plotted correctly. I then added an EMA to the chart, and that generated the following error message for my indicator:
Error on calling ‘On Render’ method on bar 7169. Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
The rectangle disappeared, leaving only the arrow.
I then changed the color of the EMA line, which caused a recalculation of both indicators. The rectangle then reappeared and there was no error message. I then changed the thickness of the EMA line. Once again, the error message was generated, and the rectangle was removed. I then changed the color of the EMA line again and the rectangle reappeared, with no error message.
I decided to check if the issue occurred with other indicators, so I removed the EMA from the chart. That caused the rectangle to disappear again with the same error message. I then added a Stochastic indicator to the chart, and the rectangle reappeared.
Can you explain why making changes to the EMA and Stochastic would influence the success or failure of the On Render method in my indicator?
How can I determine if the indicator is attempting to write to protected memory?
Thanks in advance for any help.
Comment