Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sharing properties with other classes

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

    Sharing properties with other classes

    Hello! Had a quick question regarding properties and how to share them.

    Example

    Indicator A
    Code:
    default properties....
    testInt = 5;
    
    #region properties...
    [Range(0, int.MaxValue)]
    [NinjaScriptProperty]
    
    public int testInt
    
    { get; set; }
    Addon Class X

    Code:
    somefunction(){
    if(testInt <2)
    }
    I realized that I could just drill down testInt in somefunction(testInt) from the indicator. I was hoping not to do that since i'm going to have a lot of different properties.

    My first thought was to create a static class "Config" and set the values in the config class to the property value. This is not working though. Granted i'm not the best at c#. More of a JS dev.

    any suggestions here would be appreciated!

    #2
    Hello jaboo,

    Thanks for your post.

    Can you clarify what your specific goal is?

    Are you making an add-on and want indicator properties?

    Or are you trying to share properties with indicators/

    feel free to add further clarifying information.

    Comment


      #3
      Thanks. I just puit it in configure state and every worked as intended.

      but yes, I just wanted to share the properties with another class.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      68 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      150 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      100 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      288 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X