On Indicator there is no issues, but when the same code is used by Strategy, if the property that was removed is set as NinjaScriptProperty, I get an error message:
public void ToggleProperties(string[] toggleProperties, bool toggleCondition, PropertyDescriptorCollection propertyDescriptorCollection) { // NinjaTrader internal logic determines for a given strategy PropertyDescriptor[] toggles = new PropertyDescriptor[toggleProperties.Count()]; for (int i=0; i < toggleProperties.Count(); i++) { toggles[i] = propertyDescriptorCollection[toggleProperties[i]]; propertyDescriptorCollection.Remove(toggles[i]); if (toggleCondition) propertyDescriptorCollection.Add(toggles[i]); } }
Comment