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 gentlebenthebear, Today, 01:30 AM
        2 responses
        13 views
        0 likes
        Last Post gentlebenthebear  
        Started by Kaledus, Today, 01:29 PM
        2 responses
        8 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by frankthearm, Yesterday, 09:08 AM
        13 responses
        45 views
        0 likes
        Last Post frankthearm  
        Started by PaulMohn, Today, 12:36 PM
        2 responses
        16 views
        0 likes
        Last Post PaulMohn  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        2 responses
        56 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Working...
        X