A common pitfall with NinjaTrader 7  strategies is the default parameters are defined on a per strategy basis.  This means that each strategy can have only one default parameter set.    Using several strategies and several instruments the user is often forced to   re- input the parameters at each program start. This procedure is prone to errors   and also very time consuming. In cas of a crash all your parameters might be lost. As an enhancement to the NinaTrader logic I came up with the following solution: 1. Parameters are saved relative to the instrument and to an external .xml file, for example FDAX 03-10-MyStrategy1.xml ES 03-10-MyStrategy1.xml Whenever you load a new strategy the parameters contained in the .xml file are   loaded. 2. Instrument Lists are supported: When you load an Instrument List into a strategy each single strategy will load parameters from its .xml parameter file.
1. Add reference to StrategyPersistenceHandler.dll 2. Derive your class from StrategyWithPersistentParameters 3.Call StrategyXmlInitialize() 4. Define a function public override void Deserialize() and define the parameters to use from the loaded parameterset. 5. Optional: define a function AccountContraints for special handling (for example Day order versus GTC orders) 6. Call SaveParams() where convenient for you 7. (if you dont’like the deriving from StrategyWithPersitentParameters: Source code for StrategyWithPersitentParameters is supplied and you can incorporate also directy in your strategies.
My interest is an automatic Email or SMS utility.  So I defined the email address and SMS mobile number as global variables. I defined also 2 bool flags, bEmail and bSms. These 2 flags define whether the Email or Sms option is active. Since I use the StrategyPersistenceHandler.dll plugin I the parameters are persistent. You have 2 functions only: saveGlobals and loadGlobals.. As additional convenience you can edit the globals directly from the new strategy dialog and the globals are just the parameters of the GlobalSettings strategy. source code of GlobalSettings is available on request.
Example of integration with your strategy:
Example 2: Defining and recalling Global Session parameters from any place in your code.
Per instrument Strategy persistence for NinjaTrader 7
Start strategy1 on Instrument list (contains ES 09-11 and NQ 09-11)
=> Strategy1 ES 09-11
=> Strategy1 NQ 09-11
ES 09-11.parameters.xml
NQ 09-11.parameters.xml
3. This addon can be integrated in all strategies where you have source code. 4. The advantages are: ->high protection of your parameters sets (the .xml file  does survive NT crashes) ->less clutter in the ControlCenter Strategy Tab Window.   Only active strategies must be present and disabled strategies can be safely  removed. -->What you see is what you get: All parameters actually loaded are visible in the New Strategy Dialog and you can be sure that these are actually loaded.  (This is not the case with most home-made solutions for strategy persistence. ->Remember: You are moving real money with your strategies and usually one single   typo in the parameters will cost you more than a full license. ->Easily port parameters from one computer to another   computer (by copying the .xml files)      
Strategy persistence (NT7)