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 trilliantrader, 04-18-2024, 08:16 AM
      4 responses
      18 views
      0 likes
      Last Post trilliantrader  
      Started by mgco4you, Today, 09:46 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by wzgy0920, Today, 09:53 PM
      0 responses
      9 views
      0 likes
      Last Post wzgy0920  
      Started by Rapine Heihei, Today, 08:19 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by Rapine Heihei, Today, 08:25 PM
      0 responses
      10 views
      0 likes
      Last Post Rapine Heihei  
      Working...
      X