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

Cross Plot size issues

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

    Cross Plot size issues

    Hello NT support,

    I have been developing a indicator that utilizes Crosses on the plot. However, In NT& I could set the crosses to be very large such as 100 for a large cross on size. In NT7 the cross would appear large and look like a cross, however in NT8 it looks like a square at that size.

    I am needing to keep utilizing the crosses in NT8, is there a way to make it so I can retain the sizing but make it look like a cross and not a 'square'

    #2
    Hi, thanks for your question.

    Do you have a test script or screen shots of the problem you are seeing? I like to use tiny take to easily share screen shots:
    TinyTake: Enhance your business with our platform for customer training, community engagement, and idea management. Streamline education, foster collaboration, and drive innovation.


    I look forward to hearing from you.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      An example, just modified MACD to do crosses on the plot, set the Stroke to 40 and the crosses look like pixelated squares.

      This is just an example, but using this in other situations will produce the same issue.In NT7 you could set the size to 20, 40 and 100 and the crosses would just get bigger and not 'thicker'

      Code:
      #region Using declarations
      using System;
      using System.Collections.Generic;
      using System.ComponentModel;
      using System.ComponentModel.DataAnnotations;
      using System.Linq;
      using System.Text;
      using System.Threading.Tasks;
      using System.Windows;
      using System.Windows.Input;
      using System.Windows.Media;
      using System.Xml.Serialization;
      using NinjaTrader.Cbi;
      using NinjaTrader.Gui;
      using NinjaTrader.Gui.Chart;
      using NinjaTrader.Gui.SuperDom;
      using NinjaTrader.Gui.Tools;
      using NinjaTrader.Data;
      using NinjaTrader.NinjaScript;
      using NinjaTrader.Core.FloatingPoint;
      using NinjaTrader.NinjaScript.DrawingTools;
      #endregion
      
      //This namespace holds Indicators in this folder and is required. Do not change it.
      namespace NinjaTrader.NinjaScript.Indicators
      {
          public class MACDArrows : Indicator
          {
      
          private NinjaTrader.NinjaScript.Indicators.MACD myMACD;
              protected override void OnStateChange()
              {
                  if (State == State.SetDefaults)
                  {
                      Description                                    = @"Enter the description for your new custom Indicator here.";
                      Name                                        = "MACDArrows";
                      Calculate                                    = Calculate.OnBarClose;
                      IsOverlay                                    = false;
                      DisplayInDataBox                            = true;
                      DrawOnPricePanel                            = true;
                      DrawHorizontalGridLines                        = true;
                      DrawVerticalGridLines                        = true;
                      PaintPriceMarkers                            = true;
                      ScaleJustification                            = NinjaTrader.Gui.Chart.ScaleJustification.Right;
                      //Disable this property if your indicator requires custom values that cumulate with each new market data event.
                      //See Help Guide for additional information.
                      IsSuspendedWhileInactive                    = true;
                  }
                  else if (State == State.Configure)
                  {
                      this.AddPlot(new Stroke(Brushes.Yellow,40),PlotStyle.Cross,"test");
                      myMACD= MACD(BarsArray[0], 12,26,9);
      
                  }
              }
      
              protected override void OnBarUpdate()
              {
      
                  if(CurrentBar<20) return;
      
                  if(CrossAbove(myMACD.Default, myMACD.Avg,1))
                  {
                      Values[0] = myMACD.Avg;
                      //Draw.ArrowUp(this, "uparrow"+CurrentBar, true, 0, Low[0], Brushes.Lime);
                  }
      
                  if(CrossBelow(myMACD.Default, myMACD.Avg,1))
                  {
                      Values[0] = myMACD.Avg;
                      //Draw.ArrowDown(this, "Down"+CurrentBar, true, 0, High[0], Brushes.Pink);
                  }
      
      
              }
          }
      }

      Comment


        #4
        Hello WHICKED, thanks for your reply.

        That parameter in the Stroke class is measured in pixels, so reducing it would make the x's more defined. The size of the crosses will depend on the x-axis scaling of the chart, so the more zoomed in the x axis is, the bigger the crosses will be.

        Please let me know if I can assist any further.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thats all good and fine, how do I make the crosses larger, I am not worried about definition. I just want to make it stand out and large on the plot.

          Comment


            #6
            Hi WHICKED, thanks for your reply.

            The Crosses will not be larger than the width of each bar, so you would need to increase the time axis on the chart itself to make the crosses larger.

            Chris L.NinjaTrader Customer Service

            Comment


              #7
              That was not needed in NT7. You could plot large crosses irregardless of time axis width.

              In NT7 if you defined a plot in NT7 as such

              Code:
              Pen cross = new Pen(Color.Gray,80);
              
              Add(new Plot(cross,PlotStyle.Cross,"MACDCross"));
              Then as you get the macd crossing over you could add the cross to the series and it would display a rather large cross that was an actual cross shape and not a 'square' like it does in NT8.

              Comment


                #8
                Hello WHICKED,

                I checked with Product Management and the change is intentional. NinjaTrader 7 adjusted the object width and line width stayed the same. NinjaTrader 8 adjusts the line width and object width.

                I opened a feature request to track interest behind changing this back and added a vote on your behalf. The ticket ID is SFT-4836. This is an internal number, but for anyone else wishing to have their interest tracked, please let our support staff know that you would like a vote added for this request.

                Feature Request Disclaimer

                We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

                When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

                Release Notes -
                https://ninjatrader.com/support/help...ease_notes.htm

                If you require this functionality in the meantime, you can use SharpDX for your own custom plotting. To get more acquainted with SharpDX rendering, please see the Help Guide article below, and please see the SampleCustomRender indicator that comes with NinjaTrader.



                OnRender's documentation also gives an example for how you can override standard plot behaviors.

                OnRender - https://ninjatrader.com/support/help...8/onrender.htm

                We look forward to assisting.
                JimNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Tin34, Today, 03:30 AM
                2 responses
                15 views
                0 likes
                Last Post Tin34
                by Tin34
                 
                Started by sastrades, Yesterday, 09:59 AM
                2 responses
                28 views
                0 likes
                Last Post brucerobinson  
                Started by ETFVoyageur, Today, 12:52 AM
                1 response
                14 views
                0 likes
                Last Post Leeroy_Jenkins  
                Started by lollers, Today, 03:26 AM
                0 responses
                10 views
                0 likes
                Last Post lollers
                by lollers
                 
                Started by aliyahany, Today, 03:16 AM
                0 responses
                2 views
                0 likes
                Last Post aliyahany  
                Working...
                X