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

Plot Opacity in Indicator Properties

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

    Plot Opacity in Indicator Properties

    Hi. I've searched the internet and the Ninjatrader forum but can't find what I'm looking for.

    I have an indicator with a number of Plots. I used to have the option of setting the plot opacity from within the Properties for the indicator. For some reason (I've tried to find why) the Opacity% config has disappeared from the dialogue box where you can set the Color, DashStyle, PlotStyle and Width.
    I'm more than happy setting the Opacity from within the indicator code but to make the indicator user friendly I'm looking to set the opacity in the Properties box.

    I've attached two images. One has the Opacity% and the other is the current result without the Opacity%. What is the best way to put the Opacity% back?

    Thanks in advance for any assistance.


    #2
    Hello fling_wing,

    I don't see an opacity input for the standard plot picker for other indicators and don't recall that being an option for plots in the past. You seem to have an image of the opacity existing on a plot, do you have that script and is it able to show the opacity input with that plot 'Mom"? If so are we able to view the code for the plot being used? that may help to understand what is different between the two plots you have shown.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,

      The indicator with Opacity% in the plot dialogue is a purchased indicator from years ago so it's protected and therefore I can't get to the code (tried that). It has outputs which my indicator uses. As I said, I did have the Opacity% and then it disappeared. I presume it was perhaps taking it from the locked indicator outputs somehow which meant it was displayed within my ind.

      I've had a look through the NT indicators and found TrendLines which has plots with Opacity% within the dialogue. While it displays Opacity% it doesn't show PlotStyle in the dialogue. I can also see within the TrendLines properties window that the plots are not listed under the usual 'Plots' tag within the properties window. From that I'm presuming the plots are not set in the State.SetDefaults but in State.Configure (or similar)??

      I'm adding plots in my indicator in the State.SetDefaults as so:
      Code:
      AddPlot(new Stroke(Brushes.RoyalBlue, DashStyleHelper.Solid,9,100), PlotStyle.Dot, "Plotname");
      I've added the Opacity '100' in the hope it gave me the opacity option within the properties window but it hasn't. I didn't have this specified previously in my code.

      Your further thoughts?

      Comment


        #4
        Hello fling_wing,

        Thank you for the reply.

        The trendlines specifically hides its AddPlot by using State.Configure to add the plot and then uses a Stroke to select colors which includes an opacity:

        Code:
        [Display(ResourceType = typeof(Custom.Resource), Name = "TrendLinesTrendLineHigh", GroupName = "NinjaScriptIndicatorVisualGroup", Order = 1800)]
        public Stroke TrendLineHighStroke { get; set; }
        I am not aware of a way to make the Plot selector specifically include an Opacity, you can however set a color with transparency to a plot in code. You could use an approach like shown in the trendlines to hide your plots and use custom stroke properties instead.

        I look forward to being of further assistance.

        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse,

          That's what I ended up doing- adding the Plots to the State.Config and making a custom variable that I can change within the indicator properties for Opacity. Would still like to know how Opacity was added to a Plot though.

          I reached out to the developer of the indicators (they are member here on the forums), asking how they coded the Opacity into the Plot properties but as yet I've not heard back from them.

          A request if I may? Is it possible to have Opacity added to Plot properties as a NT standard?

          Cheers

          fling_wing

          Comment


            #6
            Originally posted by fling_wing View Post
            Hi Jesse,

            That's what I ended up doing- adding the Plots to the State.Config and making a custom variable that I can change within the indicator properties for Opacity. Would still like to know how Opacity was added to a Plot though.

            I reached out to the developer of the indicators (they are member here on the forums), asking how they coded the Opacity into the Plot properties but as yet I've not heard back from them.

            A request if I may? Is it possible to have Opacity added to Plot properties as a NT standard?

            Cheers

            fling_wing
            Just use "Plots" for the GroupName.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by gemify, 11-11-2022, 11:52 AM
            6 responses
            803 views
            2 likes
            Last Post ultls
            by ultls
             
            Started by ScottWalsh, Today, 04:52 PM
            0 responses
            3 views
            0 likes
            Last Post ScottWalsh  
            Started by ScottWalsh, Today, 04:29 PM
            0 responses
            7 views
            0 likes
            Last Post ScottWalsh  
            Started by rtwave, 04-12-2024, 09:30 AM
            2 responses
            22 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by tsantospinto, 04-12-2024, 07:04 PM
            5 responses
            70 views
            0 likes
            Last Post tsantospinto  
            Working...
            X