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

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.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by maybeimnotrader, Yesterday, 05:46 PM
        5 responses
        24 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by NRITV, Today, 01:15 PM
        0 responses
        2 views
        0 likes
        Last Post NRITV
        by NRITV
         
        Started by quantismo, Yesterday, 05:13 PM
        2 responses
        16 views
        0 likes
        Last Post quantismo  
        Started by frankthearm, Today, 09:08 AM
        6 responses
        26 views
        0 likes
        Last Post frankthearm  
        Started by adeelshahzad, Today, 03:54 AM
        5 responses
        33 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X