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

Creating, and working with AddOns

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

    Creating, and working with AddOns

    Hello,

    When creating addons, do they need to have windows created in order to work?

    I have two strategies that work simultaneously and would like for them to transfer values into an addon so that both strategies can reference the addon and in a sense, "talk" to each other. For this, I don't see a need to create windows, it will be used just as a container for formulas and values to reference freely between strategies.

    #2
    Hello Don22Trader1,

    Addons do not need windows to work, the addon class you initially create can simply use its OnStateChange to execute code when the addon class starts.

    What you described would be possible within the C# framework. If you are trying to make a shared class or shared code you don't need to make specifically an addon, you can simply put your class in the addon folder and then each strategy could reference that code by using the normal C# namespace.Class syntax. This is an area where our support can't really assist but would generally suggest to explore using classes in C# language from external resources. If the intention is to share runtime data you would also be looking at using static which is another C# concept.

    Please let me know if I may be of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      You can use static variables in an abstract base class.

      For "abstract base class" part of the problem, study this example.

      Comment


        #4
        I know it's a bit late, but I personally use Memory-Mapped Files. Each strategy would leave a value(s) in memory for each other. You can make it as complicated as you want.

        MemoryMappedFile is an interesting new class in version 4.0 of the .NET Framework which resides in the System.IO.MemoryMappedFiles namespace.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,789 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        63 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X