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

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 Kaledus, Today, 01:29 PM
      5 responses
      12 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by Waxavi, Today, 02:00 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by alifarahani, Today, 09:40 AM
      5 responses
      23 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by gentlebenthebear, Today, 01:30 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by PhillT, Today, 02:16 PM
      2 responses
      7 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Working...
      X