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 NullPointStrategies, Today, 05:17 AM
          0 responses
          52 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X