• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plot dots

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

    Plot dots

    Hi,
    I have a simple idea for indicator but I really bad at c#. I don't understand how to plot dots. Pls help.

    /// <summary>
    /// Wick
    /// </summary>
    [Description("Wick")]
    public class Wick : Indicator
    {
    #region Variables
    // Wizard generated variables
    private int wick_size = 4; // Default setting for Wick_size
    // User defined variables (add any user defined variables below)
    #endregion

    /// <summary>
    /// This method is used to configure the indicator and is called once before any bar data is loaded.
    /// </summary>
    protected override void Initialize()
    {
    // Add(new Plot(Color.Blue, PlotStyle.Dot, "Dotz"));
    Overlay = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()

    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    {
    if ((High[0] - Open[0] == wick_size * TickSize) && (Open[0] > Close[0]))
    Plots[0].PlotStyle = PlotStyle.Dot;
    return;

    if ((Open[0] - Low[0] == wick_size * TickSize) && (Open[0] < Close[0]))
    Plots[0].PlotStyle = PlotStyle.Dot;
    return;

    {
    }


    }

    #2
    Hello Leeroy_Jenkins,

    Thanks for your post.

    An Add() line that is commented will not add a plot.

    I have included an example that shows how an indicator can use PlotStyle.Dot that you can reference. I also recommend the indicator tutorials for the Help Guide for further practice in making indicators.

    Indicator tutorials - https://ninjatrader.com/support/help...ndicators2.htm

    Please let us know if we can be of further assistance.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Finally get it. Big thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by nepenthean, Today, 08:01 AM
      0 responses
      1 view
      0 likes
      Last Post nepenthean  
      Started by bxl2019, Today, 07:59 AM
      0 responses
      0 views
      0 likes
      Last Post bxl2019
      by bxl2019
       
      Started by tcfcigvo, Yesterday, 11:39 PM
      0 responses
      7 views
      0 likes
      Last Post tcfcigvo  
      Started by BobbyWan, Yesterday, 09:15 PM
      0 responses
      11 views
      0 likes
      Last Post BobbyWan  
      Started by trader14, Yesterday, 08:23 PM
      0 responses
      6 views
      0 likes
      Last Post trader14  
      Working...
      X