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

Set plot color equal to other plot color

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

    Set plot color equal to other plot color

    Scenario:

    I want to set a plot color equal to another plots color. I tried "PlotBrushes[LineNumber + PlotOffset][0] = PlotBrushes[0][0] ;//Use override color" but doesn't do anything.
    I used to do this in Ninja 7 all the time but seem to have an issue on Nina 8.

    Question:

    I am thinking it is a syntax issue on Ninja 8. What is the correct syntax to set one plots color equal to another plot?

    Cheers

    #2
    Are you trying to set the plot's overall color e.g. permanently for all bars to another plot's overall color? Or, are you trying to copy the overridden color of an individual bar from one plot to another? If you mean for that individual bar, you can do something like PlotBrushes[2][0] = PlotBrushes[0][0]; which would copy plot index #0's color to plot index Forum for the current bar. If you mean in general, those are properties of the Plots[] object e.g. Plots[2].Brush; but those are set up "once and for all" when the plot is configured.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello ct,

      Thanks for your post.

      QuantKey_Bruce is correct. To change the color of an individual bar you may use PlotBrushes[int PlotIndex][int barsAgo] as QuantKey_Bruce explained.

      The code might look something like PlotBrushes[1][0] = PlotBrushes[0][0];.

      Plots[int index].Brush would be used to change the color of the entire plot series.

      An example of this would be Plots[0].Brush = Brushes.Green;

      See the help guide pages below for more information and sample code.

      PlotBrushes: https://ninjatrader.com/support/help...lotbrushes.htm
      Plots: https://ninjatrader.com/support/help.../nt8/plots.htm

      Please let me know if I may assist further.

      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by techgetgame, Yesterday, 11:42 PM
      0 responses
      8 views
      0 likes
      Last Post techgetgame  
      Started by sephichapdson, Yesterday, 11:36 PM
      0 responses
      2 views
      0 likes
      Last Post sephichapdson  
      Started by bortz, 11-06-2023, 08:04 AM
      47 responses
      1,613 views
      0 likes
      Last Post aligator  
      Started by jaybedreamin, Yesterday, 05:56 PM
      0 responses
      10 views
      0 likes
      Last Post jaybedreamin  
      Started by DJ888, 04-16-2024, 06:09 PM
      6 responses
      20 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Working...
      X