NinjaScript > Educational Resources > Tips > User Defined Methods |
|
You can create user defined methods (global methods or functions) that can be accessed by all custom indicators and strategies. User defined methods should ONLY be created if you intend to re-use these methods over and over again across different custom indicators or strategies. Otherwise, just code your method logic directly into your indicator or strategy.
UserDefinedMethods.cs You can define and manage all of your user defined methods from within one of two available UserDefinedMethods.cs files.
You can not share user defined methods created for custom strategies with custom indicators. You can edit and manage the UserDefinedMethods.cs file via Tools-->Edit NinjaScript-->Indicators or Tools-->Edit NinjaScript-->Strategies menus from within the NinjaTrader Control Center window.
UserDefinedMethods.cs files have unique icons in the Indicators or Strategy Dialog windows.
Creating A Separate File Per User Defined Method (Function)
|