Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on getting/setting property : Value cannot be null

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

    Error on getting/setting property : Value cannot be null

    Hello.

    I am experiencing error

    Error on getting/setting property 'My_Parameter' for NinjaScript 'My_Strategy/-1': Value cannot be null.
    Parameter name: Strategy 'My_Strategy/-1': no such parameter 'My_Parameter'


    while optimization.

    It happens for each parameter with attribute [Browsable(false)].

    Am I doing something wrong?
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Can you provide the full code for the input?

    Is there a default being set for the input? If so, what is the default?

    Attached is a test where I have made two inputs, one with [Browsable(false)] one without. I am not able to reproduce.

    Are you able to reproduce the error with the test script attached?
    Attached Files
    Last edited by NinjaTrader_ChelseaB; 09-18-2018, 09:52 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello, Chelsea

      Please, look video below.
      I got same error message with Your script while optimization:
      Error on getting/setting property 'TestInput1' for NinjaScript 'BrowseableFalseInputTest/-1': Value cannot be null.
      Parameter name: Strategy 'BrowseableFalseInputTest/-1': no such parameter 'TestInput1'
      Error on getting/setting property 'TestInput1' for NinjaScript 'BrowseableFalseInputTest/-1': Value cannot be null.
      Parameter name: Strategy 'BrowseableFalseInputTest/-1': no such parameter 'TestInput1'


      World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


      In my script I use both old and modern setters approach with same result.
      Only [Browsable(true)] let optimization start.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hi fx.practic,

        I overlooked that the [NinjaScriptProperty] attribute was still applied. This need to be removed.

        The [Browsable(false)] attribute hides the property from the UI. The [NinjaScriptProperty] attribute if removed will prevent the property from showing in the overloads and list of optimizable inputs.

        An object with [NinjaScriptProperty] applied must be Browsable in the UI to be optimized over.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          This helps, Thank You, Chelsea!
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          77 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          40 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          63 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          63 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X