Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Browsable(false) for def indicator property breaks result

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

    Browsable(false) for def indicator property breaks result

    Hi

    I have a very simple indicator for which I want to 'force' the calculation mode to be Calculation.OnPriceChange. To achieve this, used [Browsable(false)] which works fine to hide the property on the indicators panel. But as soon as I hide it, the code weirdly stops working as intended. Somehow any default property that gets hidden goes back to it's default value, in the case of Calculation, it changes to the first const: Calculation.OnBarClose.

    In the State.SetDefaults function Calculation.OnPriceChange is assigned, but when the Property is set to [Browsable(false)] the calculations are made OnBarClose, even though when Printing this.Calculation.ToString() "OnPriceChange" gets printed.

    I have two copies of the indicator, one with, the other without the following piece of code:
    Code:
    [Browsable(false)]
    public Calculate Calculate
    {get; set; }
    The one without that piece of code shows the Calculation property on the Indicators Panel, and works as intended.
    The one with those lines hides the Calculation property, but even when setting the calculation mode to OnPriceChange, the calculations are made OnBarClose.

    Any idea on how this can be solved?

    Any help is appreciated. The indicator is already working fine in every other aspect, but if this can be hidden and the results correct it would be nice.

    Thanks!​
    Last edited by DonMiguelo; 12-28-2024, 10:53 AM. Reason: typo

    #2
    Instead, just put Calculate = Calculate.OnPriceChange; in State == State.Configure. It will still show up in the parameters but will not allow changing.
    eDanny
    NinjaTrader Ecosystem Vendor - Integrity Traders

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    553 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    100 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    543 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    546 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X