Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Syntax

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

    Strategy Syntax

    I'm using a strategy with this in the Initialize section;

    Add(StrategyPlot(0));
    StrategyPlot(0).Plots[0].Pen.Color = Color.Lime;
    StrategyPlot(0).PanelUI = 3;

    I am unable however to find the syntax to designate the plot style (bar, line, etc) and width (1,2, etc) for this plot. Would you please point me in the direction where I can find this?

    thanks,

    Safetrading

    #2
    GM Safetrading, please try with the snippets shown in our tip for adding indicators to strategies - http://www.ninjatrader.com/support/f...ead.php?t=3228

    Comment


      #3
      Strategy Syntax

      I received the link from you regarding the Plot syntax. It was helpful except for one item. I did not see anything referring to how to designate the PlotStyle, ie, Line, Bar, etc. I tried using the following which was a similar format to the other Pen.XXX, but it did not work;

      StrategyPlot(1).Plots[0].Pen.Style = Bar;

      I would appreciate it if you could show me this one as well. Thanks again for your assistance.

      Safetrading

      Originally posted by NinjaTrader_Bertrand View Post
      GM Safetrading, please try with the snippets shown in our tip for adding indicators to strategies - http://www.ninjatrader.com/support/f...ead.php?t=3228

      Comment


        #4
        Sorry about missing that part, this could unfortunately not be set / changed this way programmatically. But you could change it for the plot directly in the StrategyPlot indicator itself.

        Comment


          #5
          This is most helpful indeed. What would the proper syntax be to change the lable of the plot from StrategyPlot? It gets kind of confusing when all the indicators are the same name.

          I tried StrategyPlot(0).Plots[0].Name = "xxx" but nothing seemed to change.

          Comment


            #6
            Also, I've added three indicators to my strategy. The third being a ROC indicator which is a ratio of two other instruments. It plots fine on the chart, but when I try to add a line at the "0" level, it crashes NT.


            StrategyPlot(2).Lines[0].Value = 20;

            Comment


              #7
              reticent67, glad to hear - both items you mentioned would unfortunately not be supported for this technique, please add / change them in the originating indicator you add for display.

              Comment


                #8
                Originally posted by safetrading View Post
                I received the link from you regarding the Plot syntax. It was helpful except for one item. I did not see anything referring to how to designate the PlotStyle, ie, Line, Bar, etc. I tried using the following which was a similar format to the other Pen.XXX, but it did not work;

                StrategyPlot(1).Plots[0].Pen.Style = Bar;

                I would appreciate it if you could show me this one as well. Thanks again for your assistance.

                Safetrading
                I believe that for Pens, the style is set with DashStyle, not Style.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                657 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                373 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
                579 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X