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

Drawing Object on Added Data Series - Is it Possible?

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

    Drawing Object on Added Data Series - Is it Possible?

    Dear Support,

    When drawing an object (i.e. Draw.Line(), etc) on an added secondary data series, how the indexing for Draw.Line() is coded to make sure the object is drawn on the added data series plot and not the primary data series plot in the following:

    Code:
    Draw.Line(this, "EMUP", false, Index1, emup, Index2, emup, Brushes.Green, DashStyleHelper.Solid, 3);
    Using the "SampleSecondarySeriesAsAdddInputSeries" example for two instances of Swing indicator (Daily, and Weekly as AddedInput series), I want to draw a line connecting the last two high pivots at Index1 and Index2 on the Added Secondary Input Series.

    Thanks.

    #2
    Hello aligator,

    When using AddDataSeries, no additional series are visually added but the BarsAgo would represent the series calling OnBarUpdate. If you call the Draw syntax during one of the other BarsInProgress updates, the BarsAgo would relate to that series. If you are trying to draw on the primary series with a BarsAgo you would need to execute that logic from BarsInProgress 0.

    I cannot see any way this could be accomplished from the secondary series in relation to the primary as the series may not be identical intervals or time. 10 bars ago to the primary may mean a completely different point in the chart from the secondary series.

    Most commonly you would need to store this value from the secondary series and then plot it from the primary, or just access the secondary series value from the primary series: Closes[1][0] for example.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, 04-17-2024, 06:40 PM
    6 responses
    49 views
    0 likes
    Last Post algospoke  
    Started by arvidvanstaey, Today, 02:19 PM
    4 responses
    11 views
    0 likes
    Last Post arvidvanstaey  
    Started by samish18, 04-17-2024, 08:57 AM
    16 responses
    61 views
    0 likes
    Last Post samish18  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    9 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    21 views
    0 likes
    Last Post traderqz  
    Working...
    X