Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StrategyPlot and PlotStyle.Dot

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

    StrategyPlot and PlotStyle.Dot

    Hi,

    For some reason when I set the PlotStyle of StrategyPlot to Dot it will no longer change color.

    This works fine for example:

    StrategyPlot(index).Plots[0].PlotStyle = PlotStyle.Square;
    StrategyPlot(index).Plots[0].Pen.Color = Color.Green;

    but this just draws the plot in a color that looks like HotPink.

    StrategyPlot(index).Plots[0].PlotStyle = PlotStyle.Dot;
    StrategyPlot(index).Plots[0].Pen.Color = Color.Green;

    any ideas?

    #2
    spinalwiz,

    It worked on my end. Please try removing and re-adding your strategy after you have made changes.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Ok, will try it.

      As a separate question, if you add lots of indicators to the same PanelUI in a strategy, the labels start to spread all the way across the screen and get in the way of the y-axis on the right. Is there a way of changing the label names?

      I tried:

      StrategyPlot(index).Plots[0].Name = "";

      and I also tried editing the StrategyPlot indicator to:

      Add(new Plot(new Pen(Color.HotPink, 2), PlotStyle.Line, ""));

      But neither of these worked, and their doesnt seem any way of editting the label name of an indicator from within a strategy running on a chart?

      Comment


        #4
        Please see this: http://www.ninjatrader-support2.com/...3814#post23814

        If you are talking about the actual label part as in "SMA" or whatever try: StrategyPlot(0).Name = "S"; in the strategy.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          name of a strategy

          hello

          how to set the name of the strategy to " " so the name and parameters are not displayed in the chart window?

          regards
          tradereight

          Comment


            #6
            When you run your strategy just remove the text inside the Label parameter.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              so there is no way to do this in the strategy code, to avoid doing it manually?

              anyway looking forward to ninjatrader 7 with the feature to restart ninjatrader with automatic strategy re-initialization (like in metatrader or tradestation, so strategy and parameters get saved to a specific chart window)

              Originally posted by NinjaTrader_Josh View Post
              When you run your strategy just remove the text inside the Label parameter.

              Comment


                #8
                How do you set this, StrategyPlot(0).Plots[1].PlotStyle = PlotStyle.Dot;, in the strategy? I can't find the correct syntax to set the value. Plots[0] works ok per the example.
                eDanny
                NinjaTrader Ecosystem Vendor - Integrity Traders

                Comment


                  #9
                  tradereight,

                  That is correct.

                  eDanny,

                  Please ensure you have the StrategyPlot indicator.
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    According to the sample strategy:
                    StrategyPlot(0).Plots[0].PlotStyle = PlotStyle.Dot;
                    StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
                    StrategyPlot(1).Plots[0].Pen.Color = Color.YellowGreen;

                    The StrategyPlot(1) is defined for the 2nd timeframe in the strategy? I'm looking to have more than one plot in the primary timeframe.

                    StrategyPlot(0).Value.Set = primary series
                    StrategyPlot(1).Value.Set = secondary series
                    ? = second plot in primary series?

                    As usual some of the examples are clear as mud when trying to get past the very basics.
                    eDanny
                    NinjaTrader Ecosystem Vendor - Integrity Traders

                    Comment


                      #11
                      No. StrategyPlot is always on the primary.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Ok, your sample is confusing but since we have that cleared up, how do you change the plot size?

                        StrategyPlot(0).Plots[0].Pen.Width = 2; does not work and causes the strategy to not run, even though it compiles ok.

                        Edit: Never mind, had one plot as StrategyPlot(0).Plots[1].Pen.Width = 2; which caused the problem.
                        It appears that instead of Plots[1], Plots[2], etc. StrategyPlot(1).Plots[0], StrategyPlot(2).Plots[0] is used. Again confusing.
                        Last edited by eDanny; 01-28-2009, 08:52 AM.
                        eDanny
                        NinjaTrader Ecosystem Vendor - Integrity Traders

                        Comment


                          #13
                          eDanny,

                          The sample for StrategyPlot never mentions anything about being attached to a secondary series. When you Add() an indicator it is always added to the primary, charted series.

                          Pen.Width works as expected here. You will need to debug on your end.

                          StrategyPlot() is an indicator. You are calling an indicator. This indicator does not have multiple plots so you cannot do Plot[1]. Please review the reference sample for more information.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Got it, thanks. Didn't know it was an indicator called from the strategy. You have to read every word in the comments to catch that.
                            eDanny
                            NinjaTrader Ecosystem Vendor - Integrity Traders

                            Comment

                            Latest Posts

                            Collapse

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