I am getting this error and want to know if there is a way around it.
I have an indicator that is looking through the strategies on the chart and saving one so that it can be edited but I keep getting this casting error because the strategy I am trying to save is saying it is not of type strategy. Here is the code I am using to get the strategy
if(ChartControl != null && strat == null)
{
{
}
I also tried
if(ChartControl != null && strat == null)
{
{
{
But I keep getting this error
Error on calling 'OnBarUpdate' method on bar 5038: Unable to cast object of type 'NinjaTrader.NinjaScript.Strategies.ARC.ARC_VABOAl go' to type 'NinjaTrader.NinjaScript.Strategies.Strategy
Any idea on how I can cast and not get this error?
Thanks!

Comment