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

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 ZenCortexHurry, Today, 01:07 PM
        0 responses
        1 view
        0 likes
        Last Post ZenCortexHurry  
        Started by ZenCortexHurry, Today, 01:04 PM
        0 responses
        0 views
        0 likes
        Last Post ZenCortexHurry  
        Started by f.saeidi, Today, 12:14 PM
        3 responses
        9 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Russ Moreland, Today, 12:54 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by philmg, Today, 12:55 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Working...
        X