PDA

View Full Version : Custom Indicator hangs NT on New Strategy Create


zoltran
06-05-2007, 08:36 PM
Gents

The attached custom indicator will hang NT as follows ..
1. Compile NT so that this doofus indicator is installed
2. Create a NEW Strategy
3. Stategy builder runs ...
4. Click thru until the condition builder shows
5. NT will hang when you try to add any new condition.

I did a trial and error test and removed all custom indicators/strategis on my system. This seems to be the one that is bad.
All I can see 'wrong' is that all the on-barupdate section is empty, as I never got around to doing what I wanted on this one.

I've attached my top-secret-doofus-millionair-indicator below

Not for you to fix it, but perhaps understand why NT crashed if it's installed.

Cheers
Ws

NinjaTrader_Dierk
06-05-2007, 11:52 PM
Recursive property which results in a stack overflow which no longer is trappable in .NET 2.0.

public int Num_crosses
{
get { return Num_crosses; }
set { Num_crosses = Math.Max(1, value); }
}

zoltran
06-06-2007, 12:05 AM
Sorry Dierk, I don't understand.

That looks like the code created for one of the parms by the wizard .

???

NinjaTrader_Dierk
06-06-2007, 12:07 AM
No it's not. Or it was edited. Wizard would create:

public int Num_crosses
{
get { return num_crosses; }
set { num_crosses = Math.Max(1, value); }
}

Note the caps.

whitmark
06-20-2007, 04:30 PM
Interesting . . . I was receiving a stack overflow error on a new strategy until I came across this post and noticed that I had mistyped a variable name. Whew . . . this could have taken a lot longer to figure out . . . thanks for sharing!

Regards,

Whitmark