Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Secondary symbol in NT8

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

    Secondary symbol in NT8

    Hi,

    I have a NT7 indicator which plot value for a secondary symbol (to be used for spread),
    I can't plot the same in NT8.

    Thats my code:
    Code:
    #region Variables      
    private string symbol2 = @"^SP500"; // Default setting for Symbol2
    #endregion
    
    protected override void OnBarUpdate()
    {
    if (BarsInProgress != 0)
    return;
    if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired)
    return;
    Value[0] = Closes[1][0];
    }
    I'm repeating the same in NT8 but the indicator doesn't plot anything (please see attached code).
    Am I missing something in NT8?

    Thanks.
    Attached Files
    Last edited by MAX; 10-02-2016, 12:36 PM. Reason: Want to delete- Problem solved

    #2
    Hello MAX,

    Thank you for your note.

    Under State.Configure in NinjaTrader you may be using,
    Add(“^SP500”, PeriodType. Daily, 1);

    However in NinjaTrader 8, you should use,
    AddDataSeries("^SP500", Data.BarsPeriodType.Day, 1);

    Which would allow your logic under OnBarUpdate() you’ve shared to successfully plot the value of SP500, assuming you also have something like AddPlot(Brushes.Blue, "myPlot"); under State.Configure as well.

    Please see Code Breaking Changes from NT7 to NT8.


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    594 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    554 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X