Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator plot value in a strategy returning different value

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

    Indicator plot value in a strategy returning different value

    In trying to access an indicator plot value in a strategy, the value returned in the strategy is different from the the value being plotted by the same indicator running seperately. Indicator and strategy are running on data series, ES 1 min., in different charts. The strategy appears to be returning a historical value. What do I need to do to get the correct real time plotted value from the indicator into a strategy ?
    Attached Files

    #2
    Hello BGWTEX,

    Most likely there is a difference in the chart settings between indicator and strategy. You can add indicators to strategies directly, using the add statement. This may help you allign values.
    Adding Indicators to Strategies
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I added the following code snippet into the Initialize() section of my code:
      Add(BGW_dValueAreav707_Input_V13());

      The result is the same, I'm getting what is apparently a historical value, rather than a real-time value. I have attached the Indicator and Strategy codes.
      Attached Files

      Comment


        #4
        You'll want to make sure that CalculateOnBarClose is not declared in the indicator file.

        This sample helps with Exposing indicator values that are not plots
        You can force an update call for indicator values. This is needed for indicator values that aren't plots, so might not be what you are running into.

        I ran the indicator and strategy on two different ES charts. These 3 values matched:
        Indicator value
        Plot from strategy
        Print statement from strategy

        Might need to make sure everything is aligned between the two tests - Days loaded on chart, session template, bar interval.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, Yesterday, 01:02 PM
        0 responses
        27 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        18 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        160 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        95 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        148 views
        2 likes
        Last Post CaptainJack  
        Working...
        X