Thanks for your post.
We typically advise to create shared methods in a separate file and then to create partial classes for your indicator or strategy based shared methods. You may also add code to the AddOn namespace or your own namespace as well. The NinjaScript that calls these methods will then need to reference the shared methods with the fully qualified namespace or add a using directive for that namespace to find the methods.
For example, code within:
namespace NinjaTrader.NinjaScript.AddOns.MySharedMethods { public void MyMethod() {}
NinjaTrader.NinjaScript.AddOns.MySharedMethods.MyMethod();
using NinjaTrader.NinjaScript.AddOnsMySharedMethods; ... MyMethod();
An example for shared methods that we have shared previously can be found below.
Shared Methods example: https://ninjatrader.com/support/foru...104#post457104
Please let us know if you have any additional questions.
Leave a comment: