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 judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    53 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    33 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    5 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    19 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    6 views
    0 likes
    Last Post cre8able  
    Working...
    X