Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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'


      Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.


      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 kevinenergy, 02-17-2023, 12:42 PM
          118 responses
          2,778 views
          1 like
          Last Post kevinenergy  
          Started by briansaul, Today, 05:31 AM
          0 responses
          9 views
          0 likes
          Last Post briansaul  
          Started by traderqz, Yesterday, 12:06 AM
          11 responses
          28 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by PaulMohn, Today, 03:49 AM
          0 responses
          8 views
          0 likes
          Last Post PaulMohn  
          Started by inanazsocial, Today, 01:15 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Jason  
          Working...
          X