I'm creating a custom Indicator (let's call it "Compute Indicator") that is calling other custom Indicators (let's call these "Base Indicators") that are using inside Drawing Objects (eg. Draw.Text, Draw.VerticalLine, Draw.Region, etc) to display various information.
Everything seems to be working properly when both the "Compute Indicator" and "Base Indicators" are added to a Chart but when I'm trying to use both (or even ONLY the "Compute Indicator") in a custom Strategy using the AddChartIndicator function I'm getting an error in the Strategy Analyzer saying: "Unhandled exception: Exception has been thrown by the target of an invocation." (see picture below)
This issue seems to be reproducible only when you have the construct: Strategy --> AddChartIndicator("Compute Indicator") --> "Compute Indicator" calls "Base Indicator"
To simplify things, please find attached a reproducer that creates a very simple "TestStrategy" adding just one generic "TestComputeIndicator" that is calling a "TestBaseIndicator" that uses Draw.Text to display the CurrentBar every 10 bars (Line 73 in TestBaseIndicator code). If I comment out that line, then everything works properly (but of course we don't see the CurrentBar text that supposedly we would like to see).
StrategyDrawObjectUnhandledException.zip
Could you please help solve this issue?
Thanks
Comment