Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator plot value in a strategy returns last ( current, real time ) price

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

    Indicator plot value in a strategy returns last ( current, real time ) price

    Accessing an indicator value that IS a plot from a strategy using the code :
    DVFdDevVAHi=BGW_dValueAreav707_V21(false,8,30,.7,2,0,_dValueEnums.dValueAreaTypes.TPO,0,50,1,6.75,true,300,false,2).RtVAt[0];

    the returned value is the last price, rather than the plot value. What do I need to get the current plot value ?

    #2
    Hello BGWTEX,

    Sorry, could you please clarify what you're looking for?

    Are you trying to combine CaluclateOnBarClose true / false logic within your strategy?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,
      " Sorry, could you please clarify what you're looking for? "
      I have an indicator, "BGW_dValueAreav707_V21", which has a plotted value, "RtVAt". I want to access the plotted value from a strategy. In the strategy, I have coded:

      " DVFdDevVAHi=BGW_dValueAreav707_V21(false,8,30,.7,2,0,_dValueEnums.dValueAreaTypes.TPO,0,50,1,6.75,true,300,false,2).RtVAt[0]; ".

      I am wanting to get "DVFdDevVAHi" set to the real time value of the indicator plot. What I'm getting is the real time last price traded, when referencing with [0], and last(close) price of the prior bar, when referencing with [1]. I've seen a question posted in the Forum with a similar situation, I think it was in regards to "Exposing Indicator Values", but I can't find the post.

      " Are you trying to combine CaluclateOnBarClose true / false logic within your strategy? "
      I'm sorry, I'm not clear what you're asking. I am wanting to calculate on every tick. I have the following:
      In the indicator I have commented out "CalculateOnBarClose = false;", using "//".
      In the strategy I have "CalculateOnBarClose = false;" as the last line in "Initialize()".
      When running the strategy, from the strategy window, I have "Calculate on bar close" set to "False".

      Comment


        #4
        I see, thanks for the clarification.

        This reference sample is needed when the values aren't plots. This is not applicable when you're trying to access plots.

        The syntax looks correct for accessing RtVAt. I would check the values of the indicator to make sure it's working as expected.

        For getting the right syntax for multi plot indicators it may help to use the strategy wizard condition builder. This will allow you to define conditions in point and click interface and then view the code.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        639 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        572 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X