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 pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        148 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Started by GussJ, 03-04-2020, 03:11 PM
        16 responses
        3,283 views
        0 likes
        Last Post Leafcutter  
        Working...
        X