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 pibrew, Today, 06:37 AM
      0 responses
      0 views
      0 likes
      Last Post pibrew
      by pibrew
       
      Started by rbeckmann05, Yesterday, 06:48 PM
      1 response
      12 views
      0 likes
      Last Post bltdavid  
      Started by llanqui, Today, 03:53 AM
      0 responses
      6 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      11 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      15 views
      0 likes
      Last Post AaronKoRn  
      Working...
      X