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 fitspressoburnfat, Today, 04:25 AM
        0 responses
        2 views
        0 likes
        Last Post fitspressoburnfat  
        Started by Skifree, Today, 03:41 AM
        1 response
        4 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by usazencort, Today, 01:16 AM
        0 responses
        1 view
        0 likes
        Last Post usazencort  
        Started by kaywai, 09-01-2023, 08:44 PM
        5 responses
        603 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by xiinteractive, 04-09-2024, 08:08 AM
        6 responses
        23 views
        0 likes
        Last Post xiinteractive  
        Working...
        X