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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      35 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      12 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      18 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X