Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Plot secondary bars object on the chart within a strategy script

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

    How to Plot secondary bars object on the chart within a strategy script

    Hello,

    Two questions:
    1)Is it possible to plot a secondary bar object on the chart from within the strategy script? ( I have added the bars in the initialize method like so: Add("6A 03-12", PeriodType.Minute, 1); // Index [1] ) However, I am not able to plot it using the script (like I do manually on the chart window)

    2)I have added a dataseries within my strategy script in the initialize method (var = new DataSeries(this, MaximumBarsLookBack.Infinite) How do I plot it on the chart from within the strategy script? (I do use the var.set(value) to set the dataseries from within the strategy)

    Thank you in advance!
    Gary

    #2
    Hi Gary, correct Add() series would be only used internally for calcs, but not available to add to the charting from the script - you would need to add manually like you've done on your chart.

    For plotting from a NinjaScript strategy, please see this example for a technique -

    When running a strategy on a chart you may find the need to plot values onto a chart. If these values are internal strategy calculations that are difficult to migrate to an indicator, you can use the following technique to achieve a plot. NinjaTrader 8 With NinjaTrader 8 we introduced strategy plots which provide the ability

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    646 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    367 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X