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

BarBrush on second data series

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

    BarBrush on second data series

    Hello,

    I have a strategy that trades two instruments (using AddDataSeries() for the 2nd one), this works well.


    When adding both the Master and 2nd instrument data series on the same chart, whether on the same panel or separate ones, the trade executions show up perfectly for both instruments. So far so good.

    What I haven't been able to figure out is how use BarBrush to impact the 2nd data series, I can only get it to work on the master instrument. Thought maybe using "BarsInProgress == 1" would allow me to address but it did not work.

    Is there a way to alter the properties of the 2nd data series on the chart?

    Thanks in advance.

    #2
    Hello DanPrado,

    Thanks for your post.

    A script can only perform Barbrush actions on the primary series (which would be the primary series of the chart).

    A script will only have knowledge of the primary series of the chart.


    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply.

      As an alternative maybe I could try painting a region that overlaps the candle color on the alternate series (when sharing the same chart panel)... thoughts on that, maybe you can point to an example? Or any other creative ideas?

      Appreciate your help!

      Comment


        #4
        Hello DanPrado,

        Thanks for your reply.

        You could try using BackBrushAll which would draw behind the bars on all panels,

        Reference: https://ninjatrader.com/support/help...ckbrushall.htm

        We can also leave this thread open for any forum member input who might have a creative solution.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Good learning about BackBrushAll, although it won't help this specific requirement since the brush does not apply to both series.

          Related question: can a script draw / change properties on alternate panels? Meaning that if I place two data series in a chart, each on its own panel, can the script address the 2nd panel as well?

          Comment


            #6
            Hello DanPrado,

            "can a script draw / change properties on alternate panels? Meaning that if I place two data series in a chart, each on its own panel, can the script address the 2nd panel as well?" No, an indicator type script can add its own indicator panel and draw in that and a price panel but it could not draw in two price panels. A strategy can only draw in its primary price panel.
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by alifarahani, Today, 09:40 AM
            6 responses
            36 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            14 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Waxavi, Today, 02:00 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            17 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X