• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exposing variables

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

    Exposing variables

    Hello- I created a custom indicator that takes in a certain instrument for calculations. It's a multi-instrument indicator (2 BIP's). I also have a milti-instrument strategy that calls this indicator. However, I would like to synch up the time frames between the strategy and indicator. In order to do this, I would need to find a way (if one exists) to make the time frame in the indicator an "exposed variable" that can be loaded by the strategy. Is there a way to do this? At the moment I'm doing this manually. Thanks.

    #2
    Hello ciro1963,
    Thanks for your post.

    You can expose values that are not plots by doing something similar to this reference sample:
    https://ninjatrader.com/support/helpGuides/nt7/?exposing_indicator_values_that.htm

    Let me know if I can clarify anything in that sample.
    Last edited by NinjaTrader_JoshG; 01-15-2019, 01:03 PM.
    JoshNinjaTrader Customer Service

    Comment


      #3
      Hi Josh -Yes I’m already doing this with a different variable. But the period type ( week, day, minute, etc ) that is part of the add statement in my indicator are reserved words I believe. I’m not sure if I can pass this variable from the strategy into the indicator without causing other issues. If there’s a way can you show me a specific example? Thank you
      Last edited by ciro1963; 01-15-2019, 03:46 PM.

      Comment


        #4
        ciro1963,

        You would probably need to store it as a string and expose the string.

        Do you just need to retrieve this information from your indicator inside your strategy? Are you trying to set your strategy to the same BarsPeriod?

        https://ninjatrader.com/support/help...barsperiod.htm
        JoshNinjaTrader Customer Service

        Comment


          #5
          No I’m trying to set the time period of the indicator from the strategy. It appears that the time period of the indicator is already exposed because if you apply any indicator in a chart you can set the time period externally in the chart dialog box. I just want to get access to it from a strategy

          Comment


            #6
            ciro1963,

            It sounds like you are trying to dynamically add a data series, which is not going to be possible. Have you tried just calling the indicator(s) from inside your strategy using the correct BarsArray of your Add() method?

            https://ninjatrader.com/support/help...?barsarray.htm

            This would not allow you to see the indicator on the chart but it would allow your strategy to use the indicator for calculations.

            If you really needed to plot those values on your chart as well you could use the concepts in this reference sample:
            https://ninjatrader.com/support/help..._a_ninjasc.htm
            JoshNinjaTrader Customer Service

            Comment


              #7
              I found a work around. Thanks Josh.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Revan, Yesterday, 11:53 PM
              4 responses
              21 views
              0 likes
              Last Post NinjaTrader_Jim  
              Started by Vincere, Today, 03:32 AM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_ChrisSch  
              Started by hir04068, Today, 04:26 AM
              0 responses
              5 views
              0 likes
              Last Post hir04068  
              Started by Thomas79, Today, 03:22 AM
              0 responses
              3 views
              0 likes
              Last Post Thomas79  
              Started by pjsmith, Today, 12:50 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_ChrisSch  
              Working...
              X