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

default parameter values based on instrument

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

    default parameter values based on instrument

    is it possible in NT8?

    I have the default values set up at State == State.SetDefaults
    but the "Bars.Instrument.MasterInstrument.Name " is not set at this stage
    this is what I understand from the error I get

    Error on calling 'OnStateChange' method: Object reference not set to an instance of an object.

    obviously it works when you change the defaults after the setup and while already inside the execution loop. But I wanted to have the default change while the user updates the user variables.

    thank you for your help

    #2
    anyone ? please?

    Comment


      #3
      Hello Dadarara,

      Thank you for your patience.

      Bars.Instrument.MasterInstrument.Name is not going to be available in state.set defaults and you could access this in state.configure or state.data loaded.

      Please let us know if you need further assistance.
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        thank you for coming back, though it doesn't answer my question.

        HOW and WHERE should I configure a variable such that it will be dependent on the instrument chosen in the strategy configuration menu
        AND it will also be visible and could be edited by the user ?

        Placing the default variable value in state.configure or state.dataloaded doesn't work.
        it sets the defaults but the user cant see them before pushing the RUN in the Strategy Analyzer for example.

        Comment


          #5
          Hello dadarara,

          This would not be supported as it falls under dynamically loading data series. It is suggested you only hard code symbols for the secondary instrument.

          I will add your vote to SFT-882, which requests this be support.

          Please let us know if you need further assistance.
          Alan P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by giulyko00, 04-24-2024, 12:03 PM
          7 responses
          32 views
          0 likes
          Last Post eDanny
          by eDanny
           
          Started by NM_eFe, Today, 10:13 AM
          0 responses
          4 views
          0 likes
          Last Post NM_eFe
          by NM_eFe
           
          Started by hdge4u, Yesterday, 12:23 PM
          1 response
          10 views
          0 likes
          Last Post hdge4u
          by hdge4u
           
          Started by 1001111, Today, 09:45 AM
          0 responses
          12 views
          0 likes
          Last Post 1001111
          by 1001111
           
          Started by DTSSTS, 01-28-2024, 12:07 PM
          11 responses
          561 views
          0 likes
          Last Post bmo111
          by bmo111
           
          Working...
          X