Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicators not showing in Strategy Analyzer

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

    Indicators not showing in Strategy Analyzer

    I'm working on a strategy that is using Renko bars.

    In Strategy Analyzer, I have set the primary Data Series to Renko 4.
    In the strategy, I am adding a secondary data series like so:

    Code:
               else if (State == State.Configure)
                {
                    AddRenko(null, 6, MarketDataType.Last);
                }
    	    else if (State == State.DataLoaded)
    	    {
                    _roc = ROC(BarsArray[1], Periods);
                    AddChartIndicator(_roc);
    
                    base.ClearOutputWindow();
                }
    When the brick size was the same for both the primary and secondary data series, the indicators displayed in the charts generated by the backtest. But when I changed the secondary data series to a brick 6, the indicators stopped being displayed.

    A couple of questions:
    1. is this expected behavior? When I set primary to brick 6, the indicators are shown again.

    2. I am using the conditional "BarsInProgress == 1" in OnBarUpdate(), so I assume I am generating signals based off of the Secondary data series added with "AddRenko()". How do I set the primary dataseries programatically so I can eliminate the confusion here? Basic question, but I've not seen this done in any strategy examples I have run across.

    #2
    Hello RandyT,

    Plots need consecutive bar values synced with the primary to appear on the chart.

    If you are only setting values in BarsInProgress 1, then in BarsInProgress 0 if the value is not set, set the value to the previous bars value. That way every bar has a value set for the primary series.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea,

      Can you answer question #2 for me? How do I set the primary bar type in the strategy code?

      Comment


        #4
        Hello RandyT,

        The primary series cannot be set from code. This is set from the chart or from the strategy parameters.

        You can trigger key presses to change the instrument or interval. Below is a public link to the RolloverIndicator that does this.
        https://ninjatrader.com/support/foru...php?linkid=905
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Polufson, Today, 01:37 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by mohsemian, Today, 01:36 PM
        2 responses
        7 views
        0 likes
        Last Post mohsemian  
        Started by Derjan, Today, 01:18 PM
        2 responses
        17 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by Cicero, Today, 09:41 AM
        3 responses
        18 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by johnnymustard, Today, 12:01 PM
        2 responses
        12 views
        0 likes
        Last Post johnnymustard  
        Working...
        X