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

How to expose a variable from an Indicator to the Strategy Builder?

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

    How to expose a variable from an Indicator to the Strategy Builder?

    I can access my Indicator variables from code if I unlock the strategy and do this from the script editor but I want to be able to just give my college an Indicator and have the variable available within the Strategy Builder as he is not a coder and not comfortable with writing code. It also allows him to make changes with the builder again.

    I've created public variables with get and set (some without set) and code to return the value but these don't appear in the builder.

    Is this at all possible?
    Last edited by davemclaughlin; 12-16-2016, 05:21 AM. Reason: Change the title

    #2
    Hello Dave, and thank you for your question. Once you unlock your code, it can never again be edited in the strategy builder. There are screens in the strategy builder which allow you to add custom user input variables, and you can add custom code to your NinjaScript strategy by hand in your favorite text editor without unlocking your code. Your C# code is located under (My) Documents\NinjaTrader 8\bin\Custom .
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi Jessica,

      I am looking to see how to get a value back from a custom Indicator that I will select in the Strategy Builder.

      I have a Boolean value called IsLastRising, for example in the Indicator, and I want to be able to see this from the Strategy Builder without unlocking the code etc.

      I am already using VS to develop the Indicator. I just need a way now to see the Boolean value from the Strategy Builder if this is possible without unlocking it and writing custom code.

      Comment


        #4
        The way the strategy builder works, is that it will read the embedded XML after your C# code into its memory. The only way to automatically generate this XML is through the strategy builder. Anything you write by hand in C# will not be in the XML, and thus, will not be available in the Strategy Builder. The easiest way to create the variables you would like to make available, would be to create them through strategy builder. The other option is to repeatedly create variables in Strategy Builder and study the output XML, so that you may learn how to edit the XML directly. This is an undocumented trial-and-error process, but we will be happy to answer any questions we may.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          Thanks Jessica

          I've found that if I create a series and then populate this for each bar it shows up in the stratgey build so I think I can work with that for the time being.

          Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          27 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 02-22-2024, 01:11 AM
          5 responses
          32 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 04-23-2024, 09:53 PM
          2 responses
          49 views
          0 likes
          Last Post wzgy0920  
          Started by Kensonprib, 04-28-2021, 10:11 AM
          5 responses
          193 views
          0 likes
          Last Post Hasadafa  
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,235 views
          0 likes
          Last Post xiinteractive  
          Working...
          X