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

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by funtra513, 01-15-2022, 02:20 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by akm39, Yesterday, 08:20 PM
      1 response
      22 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by robertcooney, Yesterday, 05:11 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by DTSSTS, Yesterday, 04:51 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by trader3000a, Yesterday, 03:30 PM
      0 responses
      11 views
      0 likes
      Last Post trader3000a  
      Working...
      X