• 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

Logic for where/how a plot is plotted

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

    Logic for where/how a plot is plotted

    Hi,

    Hi,

    I'm having trouble plotting an indicator of my own and I think it's because I don't understand the plot logic. I want to plot this "Slope(HMA(Fast), 2, 1)/TickSize" and I can't seem to get a line to be drawn. Can anyone help with how to get it to plot?

    I looked at the support guide and below is an example from it for AddPlot(). I have two questions. From how this is written, how does "AddPlot(Brushes.Blue, "PlotA"); " know to plot the "Values[0][0] = Median[0]; " Why is that the one it will plot?


    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Name = "Examples Indicator";

    // Add three plots and associated Series<double> objects
    AddPlot(Brushes.Blue, "PlotA"); // Defines the plot for Values[0]
    AddPlot(Brushes.Red, "PlotB"); // Defines the plot for Values[1]
    AddPlot(Brushes.Green, "PlotC"); // Defines the plot for Values[2]
    }
    }
    protected override void OnBarUpdate()
    {
    Values[0][0] = Median[0]; // Blue "Plot A"
    Values[1][0] = Low[0]; // Red "Plot B"
    Values[2][0] = High[0]; // Green "Plot C"
    }

    #2
    Hello Seastragg,

    Thanks for your post.

    From the help guide for Values: Holds an array of ISeries<double> objects holding hold the indicator's underlying calculated values. ISeries<double> values are added to this array when calling the AddPlot() method. In case of a MultiSeries indicator synched to the primary series. Reference: https://ninjatrader.com/support/help...t8/?values.htm So this is advising that using AddPlot() automatically provides the Values data series. For clarity, the order./sequence of the addPlot statements relates directly to Values[0], Values[1], Values[2] as shown in the help guide section you copied, thus PlotA points to Values[0], PlotB points to Values[1], etc. If you change the order of addplots(), for example putting PlotC first, then plotC would point to Values[0]

    The values of Slope() are likely to be quite small so make sure you are plotting in an indicator panel and not the price panel. Creating an indicator panel is done by setting IsOverLay to false: Reference: https://ninjatrader.com/support/help...?isoverlay.htm

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Uregon, Today, 09:08 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by swcooke, Today, 09:09 AM
    0 responses
    6 views
    0 likes
    Last Post swcooke
    by swcooke
     
    Started by Induna, Today, 08:44 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by TangoTX, Today, 08:36 AM
    1 response
    1 view
    0 likes
    Last Post NinjaTrader_Tyler  
    Started by abdullah, 11-15-2017, 08:44 PM
    11 responses
    822 views
    0 likes
    Last Post NinjaTrader_Kate  
    Working...
    X