I am in the process of debugging a relatively simple indicator. During compilation of some new additions to the code, NT7 crashed with an Assertion error.
I ran the indicator through the VS debugger and the call stack name that came up was
> ec2402e6bec741a0bd0334bb93bff218.dll!NinjaTrader.I ndicator.MovingAverage._TMA(int Period, int CurrentBar, NinjaTrader.Data.IDataSeries Volume, NinjaTrader.Data.DataSeries Input, NinjaTrader.Data.DataSeries average) Line 795 + 0x35 bytes C#
The offending code was:
publicstaticdouble _TMA(int Period, int CurrentBar, IDataSeries Volume, DataSeries Input, DataSeries average)
{
PB_TrailDown pb = new PB_TrailDown();
double avg=0;
avg = pb.TMA(Input, Period)[0];
return avg;
}
The issue is the line
avg = pb.TMA(Input, Period)[0];
I should point out that I am trying to call an instance method from a static method. The static method sits inside a different class than the indicator class. I have tried to do this via object reference but that completely crashes NT.
Any idea why the assertion error? Please advise. Thank you.
Comment