For the past few hours I have been working on building an NT8 indicator - doing numerous updates, compiles and then tests of that indi without issue.
Then out of the nowhere, on my last update, compile, test loop, when I click on the load indicator menu from chart I get the "Ninjatrader has stopped working" dialog and then the application closes.
I am using the 64 bit version on Windows 10
how do I resolve this?
UPDATE:
I restarted windows - did not resolve
I opened indi code in editor - recompiled, no error on compile - did not resolve issue
I then made copy of my indi source that was in ...\NinjaTrader 8\bin\Custom\Indicators
I then removed that indi using the ninjscript editor
this made it so I could once again open the indi dialog in the chart
I then obtained a backup copy of my indi that was working earlier today.
I copied it back into the ...\NinjaTrader 8\bin\Custom\Indicators folder
it automatically complied
I am back to working with my indi in the listing of available indi
SOLUTION
seems to be a coding issue on my part.....
I defined an enum outside the namespace
public enum VolumeProfileBarRange
{
All,
Visable,
BarsBack
}
in the code I used the following variable def
VolumeProfileBarRange profilerange = VolumeProfileBarRange.All;
Notice the lower case "p" on profilerange
in the properties section I maintained using the lower case "p", this is what caused the error
when I used an Upper case P (like an example I found using enums in properties parameters) the issue went away
This code DID NOT work...but complies without error or warning
[NinjaScriptProperty]
[Display(Name="Bar Range", Description="Use ALL bars of chart, only visable bars, or use the defined bars back", Order=6, GroupName = "Properties")]
public VolumeProfileBarRange profilerange
{
get { return profilerange; }
set { profilerange = value; }
}
notice the lower case "p" for profilerange in the def
public VolumeProfileBarRange profilerange
this code WORKED, changing that "p" to a "P"
[NinjaScriptProperty]
[Display(Name="Bar Range", Description="Use ALL bars of chart, only visable bars, or use the defined bars back", Order=6, GroupName = "Properties")]
public VolumeProfileBarRange Profilerange
{
get { return profilerange; }
set { profilerange = value; }
}
maybe this will help someone in future....seems weird to me that this would causes NT8 to abort on indi load from chart menu
Comment