Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Building custom C# libraries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Building custom C# libraries

    General question about C# programming with NinjaScript. Do I only have two choices of different "classes" to create, with the NinjaScript editor?

    What I'd like to do is build a small personal library, with a couple of helper utility classes. So I'd create a few of my custom indicators - say, CustomTEMA or CustomMultiStochastic - and then create a helper class, that could hold simple building-block methods like "areAllIndicatorsOversold()" or "isPriceCloseTo50DaySMA()". Then, I could build Strategies with higher-level function calls .... calls that I could re-use, with multiple Strategies.

    Does NinjaScript support something like this?

    #2
    Originally posted by pbailey19 View Post
    General question about C# programming with NinjaScript. Do I only have two choices of different "classes" to create, with the NinjaScript editor?

    What I'd like to do is build a small personal library, with a couple of helper utility classes. So I'd create a few of my custom indicators - say, CustomTEMA or CustomMultiStochastic - and then create a helper class, that could hold simple building-block methods like "areAllIndicatorsOversold()" or "isPriceCloseTo50DaySMA()". Then, I could build Strategies with higher-level function calls .... calls that I could re-use, with multiple Strategies.

    Does NinjaScript support something like this?
    This might be what you are looking for...

    Comment


      #3
      Hello pbailey19,

      Thank you for your post.

      Sledge's response here is correct, you can create User Defined Methods 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. The link Sledge provides also has two samples that you can use to get an idea of how to use these. You can also find the two samples below:
      Please let me know if you have any questions.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by warreng86, 11-10-2020, 02:04 PM
      5 responses
      1,356 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Perr0Grande, Today, 08:16 PM
      0 responses
      3 views
      0 likes
      Last Post Perr0Grande  
      Started by elderan, Today, 08:03 PM
      0 responses
      5 views
      0 likes
      Last Post elderan
      by elderan
       
      Started by algospoke, Today, 06:40 PM
      0 responses
      10 views
      0 likes
      Last Post algospoke  
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      12 views
      0 likes
      Last Post maybeimnotrader  
      Working...
      X