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

Dotted Lines for Off-Chart Indicator

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

    Dotted Lines for Off-Chart Indicator

    Hello -

    Does NT 8 support creating a dotted-line indicator? Dots for each bar-value joined by a line?


    Thanks,
    Mark

    #2
    Hello mmeninger,

    Thank you for writing to the support team.

    I am reviewing your inquiry and will be back with a reply shortly.

    I look forward to assisting further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello mmeninger,

      Thank you for the post.

      To make a dotted line, you will add a new Plot to your indicator. There is a corresponding Value[] array that you will fill with data. The Plot will reflect upon the chart whatever data you add to the Value[] array.

      Use AddPlot() to add a new plot object to your chart:



      Code:
      protected override void OnStateChange()
      {
        if (State == State.SetDefaults)
        {
          Name = "Example Indicator";
          ...
          // Adds a gold dotted line style plot
         AddPlot(new Stroke(Brushes.Goldenrod, DashStyleHelper.Dot, 2), PlotStyle.Line, "myPlot");
        }
      }
      
      ...
      
      protected override void OnBarUpdate()
      {
      	Value[0] = Close[0];
      }
      This example will draw a dotted line between the Close[] values of the bar.

      Please let me know if I may be of any further assistance.
      Chris L.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,610 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Today, 05:56 PM
      0 responses
      9 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      19 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Jon17, Today, 04:33 PM
      0 responses
      6 views
      0 likes
      Last Post Jon17
      by Jon17
       
      Started by Javierw.ok, Today, 04:12 PM
      0 responses
      16 views
      0 likes
      Last Post Javierw.ok  
      Working...
      X