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

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
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sdauteuil, 09-23-2021, 10:16 AM
    10 responses
    1,263 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Started by Grantx, 05-31-2020, 06:49 AM
    7 responses
    1,383 views
    0 likes
    Last Post marcus2300  
    Started by ETFVoyageur, 05-18-2024, 12:45 AM
    3 responses
    20 views
    0 likes
    Last Post ETFVoyageur  
    Started by sylviannyc, Today, 09:07 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by warpinator, 05-16-2024, 10:44 AM
    4 responses
    36 views
    0 likes
    Last Post warpinator  
    Working...
    X