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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    59 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    161 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    276 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X