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 RideMe, 04-07-2024, 04:54 PM
      6 responses
      31 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      2 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,281 views
      0 likes
      Last Post Leafcutter  
      Started by WHICKED, Today, 12:45 PM
      2 responses
      19 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Tim-c, Today, 02:10 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X