Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

public Class shared on multiple Assemblies

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

    public Class shared on multiple Assemblies

    Hi everyone...

    Let say I have a public class with variables used from different places.
    ..something like
    public class My_variables
    {
    public static bool MyBoolInfo
    }

    and several indicators using it, so what indicator #1 sets on My_variables.MyBoolInfo is visible for Indicator #2 and viceversa

    Now, is there a way to export an assembly with Indicator #1 and another with Indicator #2 still sharing same class variables ?
    pmaglio
    NinjaTrader Ecosystem Vendor - The Indicator Store

    #2
    Hello pmaglio,

    Yes, if the custom class is in an addon, this will allow for the export to be successful.

    Please see another thread where I have posted an example.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      (I post my question here because the other thread is closed or user protected)

      In regards to your example, my question is ;
      Is it possible to export one assembly with the clases we use frequently and then export each indicator or strategy using those clases but alone, without including them again ?
      I tried exporting your example MySharedMethodsIndicator without the addon but doenst compile.
      Thanks,
      Pablo
      pmaglio
      NinjaTrader Ecosystem Vendor - The Indicator Store

      Comment


        #4
        Hello Pablo,

        No, any thing that is called in a script must be exported with that script.
        If your indicator calls the SMA, the SMA has be exported with your indicator.
        If your indicator calls a custom method in an addon, this addon must be exported with the indicator.

        By putting these in a separate file, when importing the user can decide to use that version of the file or use one that is already imported should one exist.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        43 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        25 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X