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

Use Ninjascript to create multiple dataseries that are displayed on chart

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

    Use Ninjascript to create multiple dataseries that are displayed on chart

    I have a strategy that seems to be working well, which has a primary data series, and a second data series added during State.Configure.

    AddDataSeries("AAPL", BarsPeriodType.Tick, 1000);

    The primary data series is the same but a 2000 tick interval chart.

    The chart displays the primary chart, but how do I display the secondary chart ?

    Also how do I add arrows to the secondary chart (I can already add them to the primary chart) ?

    #2
    Hello robert99,

    Thank you for your note.

    While it is not directly possible to display the secondary series directly in a new panel, you can cause an indicator to plot prices or other values in a second panel.

    Using AddChartIndicator you can add a secondary indicator to perform plotting in another panel, we have a strategy example that demonstrates this concept: https://ninjatrader.com/support/foru...ead.php?t=6651

    Using the dummy indicator, the strategy could tell it to plot things as you need them like markers for executions or plots etc..

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you this helpful, and I just need to remember that for additional plotted data series I need to do it as an Indicator, and not a data series.

      From the samples, we have:
      AddChartIndicator(sampleOverlayPlot);

      During State.Historical I would normally remove any buttons etc I added to the charts. Is there something like / equivalent to
      RemoveChartIndicator(sampleOverlayPlot);

      I should do for object/memory cleanup (since RemoveChartIndicator is not really a valid method) ?

      Comment


        #4
        Hello robert99,

        Thank you for your reply.

        There's not a RemoveChartIndicator method - when using an indicator within a strategy it's not necessary to remove the instance as it will simply reach State.Terminated when the hosting script does.

        You can find more information on best practices for object cleanup in our help guide here:



        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by andrewtrades, Today, 04:57 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        5 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        7 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X