• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 lavalampmj, Today, 05:25 PM
        0 responses
        2 views
        0 likes
        Last Post lavalampmj  
        Started by Antares66, Today, 05:19 PM
        0 responses
        2 views
        0 likes
        Last Post Antares66  
        Started by jmneto, Today, 05:18 PM
        0 responses
        3 views
        0 likes
        Last Post jmneto
        by jmneto
         
        Started by Bobbyj78, Today, 02:21 PM
        2 responses
        12 views
        0 likes
        Last Post bltdavid  
        Started by EnveousColnago, Today, 02:10 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Ariana  
        Working...
        X