Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      649 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      573 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      576 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X