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, 05-11-2026, 05:56 AM
          0 responses
          61 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          34 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          198 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          364 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          283 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X