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

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 zstheorist, Today, 07:52 PM
        0 responses
        3 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        149 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        5 views
        0 likes
        Last Post mattbsea  
        Started by RideMe, 04-07-2024, 04:54 PM
        6 responses
        33 views
        0 likes
        Last Post RideMe
        by RideMe
         
        Started by tkaboris, Today, 05:13 PM
        0 responses
        5 views
        0 likes
        Last Post tkaboris  
        Working...
        X