Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Advanced chart example Confusion

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

    Advanced chart example Confusion

    Hi Guys, I'm confused with the advanced chart example. The attached code is used to update 8 charts, so I can insert different parameters for each chart. I used your advanced charting example in the manual but the problem is when I update the parameters they have no effect. In the region properties I see these lines from your code which seem to stop this happening:

    [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
    [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
    public DataSeries Extremeup
    {
    get { return Values[0]; }

    so I put in the lines 232-261 which changes the backgrounds ok but not the plots. So the question is how do I use the one indicator on 8 charts and input different parameters for each chart like I do with the other indicators? Basially the plots need to update. The only way I can change this one is my removing the indicator, editing and saving it with the new values then adding it back on the chart.

    Confused

    Thanks in advance
    DJ
    Attached Files

    #2
    djkiwi, can you please clarify which advanced charting example you are referring to?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Tutorial

      Hi Austin, please find attached.

      Thanks
      DJ
      Attached Files

      Comment


        #4
        I should've asked this in my last post along with the clarification, but what are you trying to do here? Create an indicator that you can change the plot colors at will? If that is the case, you'll have to create an input for your plots color. There is an example for how to use colors as inputs that can be found here.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Chart Issues

          Hi Austin, actually no the colors are not the issue. Sorry for not being clearer. The issue is I want to have parameters in region properties where I can change the chart plots, extremeup, above, neutral, below and extremedown so the chart will change.

          Now in rows 186-218 in region properties it has these lines from what was created from the system. So the question is how to I change these so I can actually put the numbers in the parameters manually and the chart will update. Exacly how I did it normally in rows 223 to 262 for the other variables. Thanks. DJ


          #region Properties
          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Extremeup
          {
          get { return Values[0]; }
          }

          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Above
          {
          get { return Values[1]; }
          }

          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Neutral
          {
          get { return Values[2]; }
          }

          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Below
          {
          get { return Values[3]; }
          }

          [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
          [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
          public DataSeries Extremedown
          {
          get { return Values[4]; }
          }

          Comment


            #6
            The code that you have written uses the inputs to change the Plots minimum and maximum transition values.

            Plots, while declared public are not inputs, and so you cannot change their values from the input dialog; only their characteristics. If you want to change Plot values, you will have to do that from inside the body of the indicator.

            Comment


              #7
              Chart Issues

              Hi and thanks again Koganam. I spent all day trying to get to the bottom of this. If this is the case then it is a major drawback for people using different plot values on multiple charts. For example, my system is geared towards 8 instruments, ES, ZB, TF, NQ,FDAX, 6E, CL and GC. The instrument traded is based on a weighted probability analysis which is nearing completion. The problem is based on the attached charts instead of having 3 custom indicators and being able to change the variables for each of the 8 instruments I now have to make 24 indicators(3 for each one).

              The only way of getting around this based on my limited knowledge in programming is to store the plot values for each instrument then use bools to select the instrument you want to use for the chart. For example for GC and TF

              Variables

              private bool gcema=true;
              private bool tfema=false;

              private double gcextremetop = 0.68;
              private double gcabove = 0.25;

              private double tfextremetop = 0.60;
              private double tfabove= 0.22;

              so the issue remains is how do I tell it if private gcema = true then put in the gc values above into the plot values below : (the below has "extremeup" so I need to substitute with whatever instrument bool flag is true, in this case gcextremeup:

              Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Extremeup"));
              Plots[0].Pen.Width = 3;
              Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "Above"));
              Plots[1].Pen.Width = 3;
              Add(new Plot(Color.FromKnownColor(KnownColor.Cyan), PlotStyle.Line, "Neutral"));
              Plots[2].Pen.Width = 3;
              Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "Below"));
              Plots[3].Pen.Width = 3;
              Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Extremedown"));
              Plots[4].Pen.Width = 4;

              Thanks
              DJ
              Attached Files
              Last edited by djkiwi; 04-18-2011, 01:15 AM.

              Comment


                #8
                Not sure that I understand. How are you selecting the instrument that you are using as the Primary Bars object?

                If you are trying to show Plots based on values, then you have to generate plots for all your values, make then transparent to hide them, then turn on the ones that you want to see by changing their color.

                Comment


                  #9
                  Chart Confusion

                  Hi Koganam. I only have one indicator per chart/instrument so the indicator is on 8 charts but the plots are different for each chart/instrument. What I am trying to do is have only one indicator and turn on the relevant plots for the selected instrument.

                  The other way of having 8 indicators with different plots for each one means any change in the underlying code has to be reflected in all of the 8.

                  Cheers
                  DJ
                  Last edited by djkiwi; 04-18-2011, 03:16 PM.

                  Comment


                    #10
                    Originally posted by djkiwi View Post
                    Hi Koganam. I only have one indicator per chart/instrument so the indicator is on 8 charts but the plots are different for each chart/instrument. What I am trying to do is have only one indicator and turn on the relevant plots for the selected instrument.

                    The other way of having 8 indicators with different plots for each one means any change in the underlying code has to be reflected in all of the 8.

                    Cheers
                    DJ
                    I must not have made myself clear. You would have one indicator with 8 plots. You turn on the plot that you want, depending on the instrument. You turn on the plot by changing its color from Transparent.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by bmartz, 03-12-2024, 06:12 AM
                    4 responses
                    31 views
                    0 likes
                    Last Post bmartz
                    by bmartz
                     
                    Started by Aviram Y, Today, 05:29 AM
                    4 responses
                    12 views
                    0 likes
                    Last Post Aviram Y  
                    Started by algospoke, 04-17-2024, 06:40 PM
                    3 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by gentlebenthebear, Today, 01:30 AM
                    1 response
                    8 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by cls71, Today, 04:45 AM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X