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 cmtjoancolmenero, 04-29-2024, 03:40 PM
        2 responses
        17 views
        0 likes
        Last Post cmtjoancolmenero  
        Started by Torontobluejays, 04-29-2024, 02:01 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by ezrollin, 02-26-2022, 11:14 PM
        10 responses
        215 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by ageeholdings, Today, 05:22 AM
        3 responses
        19 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by sugalt, Yesterday, 04:02 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Zachary  
        Working...
        X