Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SampleStrategyPlot Plots Control

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

    SampleStrategyPlot Plots Control

    Guys,

    Thanks for the "SampleStrategyPlot" strategy to plot Multi Time Frame Indicators. I now have all the values plotting the way they should on 1 chart. Very Nice.

    However I have not been able to control the plot attributes. I am having problems with code for Plot Style, Dash Style, and Auto Scale. What is the correct code to finish the snippet below?

    StrategyPlot(0).Plots[0].Pen.Color = Color.Black;
    StrategyPlot(0).Plots[0].Pen.Width = 2;

    StrategyPlot(0).Plots[0].Pen............Dash Style = Solid
    StrategyPlot(0).Plots[0].Pen............Plot Style = Line
    StrategyPlot(0).Plots[0]..................Auto Scale = False

    Thanks.

    #2
    Please see this tip: http://www.ninjatrader-support.com/v...ead.php?t=3228

    Just mix and match the two.

    For instance, DashStyle would be like this:
    StrategyPlot(0).Plots[0].Pen.DashStyle = DashStyle.Dot;

    PlotStyle and AutoScale are currently not supported. To do these you can easily go into the StrategyPlot() indicator and change them there. If you need variants just create yourself a second StrategyPlot() with a different name and use it the exact same way you would StrategyPlot().
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      You lost me with this part "To do these you can easily go into the StrategyPlot() indicator and change them there. If you need variants just create yourself a second StrategyPlot() with a different name and use it the exact same way you would StrategyPlot()."


      Using the "SampleStrategyPlot" I do not see where I can alter the Auto Scale feature from the Indicator window (see image).

      Or should I be adding some code in the this section from your sample. If so what would the code be:

      protected override void Initialize()
      {
      CalculateOnBarClose = true;

      // Create a multi-time frame strategy
      Add(PeriodType.Minute, 3);

      /* Add our blank placeholder indicators. The parameter we pass in is used to distinguish the two
      indicators from each other. */
      Add(StrategyPlot(0));
      Add(StrategyPlot(1));

      // Set the color for the indicator plots
      StrategyPlot(0).Plots[0].Pen.Color = Color.Blue;
      StrategyPlot(1).Plots[0].Pen.Color = Color.YellowGreen;

      // Set the panel which the plots will be placed on. 1 = price panel, 2 = panel under the price panel, etc.
      StrategyPlot(0).PanelUI = 1;
      StrategyPlot(1).PanelUI = 1;


      }
      Attached Files

      Comment


        #4
        When you downloaded SampleStrategyPlot() it didn't only come with a NinjaScript Strategy. In the package an indicator titled StrategyPlot() was included. You want to open up that file and make changes to PlotStyle there. It is a normal blank indicator. Just resave it with whatever name you want (i.e. StrategyPlot2()). Now when you code in the strategy you can call both StrategyPlot() and when you need a different PlotStyle you can call StrategyPlot2().
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          I changed StrategyPlot to change the PlotStyle from Line to Bar and that works fine.

          Thought I would also add a line... which does not plot.

          It should plot should it not?

          Thanks

          ps...for that matter I would like to add an EMA of the bar plot also...is that possible via StrategyPlot indicator?...or do I need to add another StrategyPlot (revised for the EMA) to my strategy?
          Attached Files
          Last edited by ATI user; 06-30-2008, 07:17 PM.

          Comment


            #6
            The StrategyPlot() in concept should just have one plot and remain empty. Do everything else you want to it from the strategy.

            It may work the way you are thinking, but I have not tried so cannot confirm it for you.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            597 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            343 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            556 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            555 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X