Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Indicator

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

    Strategy Indicator

    I have an indicator that plots a separate bar color depending on the indicators output of either +1, 0 or -1. When I add this indicator for the primary bar series in a multi-timeframe strategy it shows up correctly but when I add it to the secondary timeframe it does not plot the colors. How do I change this so that it plots the colors based on the indicator values in the multi-timeframe strategy? Thanks!

    GT

    #2
    GT, not sure I follow - since there's no MultiSeries charting with 6.5 it's expected to be plotting on the primary series (bars object) - in which order to you add those in the strategy?

    Comment


      #3
      Thank you for another quick response!

      Currently I have a 30 minute chart. In a strategy I add indicator1 that plots a green bar if the output is +1, a yellow bar if the output is 0 and a red bar if the output is -1. I the add the following in the initialize section:

      Add(PeriodType.Minute, 120);
      Add(PeriodType.Minute, 240);
      Add(StrategyPlot(0));
      Add(StrategyPlot(1));
      StrategyPlot(0).PanelUI = 3;
      StrategyPlot(1).PanelUI = 4;

      Then in the OnBarsUpdate section I use:

      StrategyPlot(0).Value.Set(Indicator1(BarsArray[1], false, 50)[0]);
      StrategyPlot(1).Value.Set(Indicator1(BarsArray[2], false, 50)[0]);

      This plots the correct value of the second and third bar series (i.e. +1,0,-1) but only plots a line at the value and does not update the color based on the indicator1 value.

      1) I assume I need to specify in my code to plot as a bar instead of a line, where and how do I do this?

      2) Do I need to go through the plot section of the code just as in the indicator and state if +1 then barColor = green? Shouldn't just adding and calling the indicator automatically do this for me? Other suggestions on how to update this?

      Thanks!

      GT

      Comment


        #4
        1. You could try something like StrategyPlot(0).Plots[0].PlotStyle = PlotStyle.Bar;

        2. If you want multiple colors you need to actually have multiple plots in the indicator itself and use the multi-colored indicators technique demonstrated here: http://www.ninjatrader-support2.com/...ead.php?t=3227
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Thank you again for the quick response. I do currently have multi colored plots in the indicator. When I add the indicator into the multi timeframe strategy the primary bars indicator works correctly but the secondary bars indicators do not. The indicator itself does work correctly when added to the primary bar chart. I will look at your suggestion for #1. Thanks!

          GT

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          672 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          379 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          111 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          577 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          582 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X