In my coding I have several functions (eg SaveChart) and constants (eg Enums) that I would like to use in both Indicators and Strategies. I've tried putting them in either of the UserDefinedMethods.cs in \Indicator or \Strategy folder and adding "using NinjaTrader.Indicator; using NinjaTrader.Strategy;" in my Indicators and Strategies but this doesn't seem to work.
To bypass the problem I replicate my code in both \Indicator and \Strategy UserDefinedMethods.cs , but having to do everything double creates a risk of missing changes and is against the "Single Point of Definition" principle I like to maintain in my coding.
What I think I'm really looking for is some kind of old fashioned %include that would insert my common code in both the UserDefinedMethods.cs - but I have no clue how to achieve this (BTW: did I already mention I'm not a C# expert ).
I'm aware this is not the support NT provides, but maybe other developers have encountered a similar issue and can help me forward.
Thanks,
Hans
Comment