Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X