Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy and Indicator Labeling Issue

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

    Strategy and Indicator Labeling Issue

    I have a custom indicator which plots three values. Each of the values are labeled separately in the indicator plot statement and when I place the indicator on a chart, the plots are labeled with my custom plot labels. When I try to use the indicator in a custom strategy, and I select which plot I wish to use in the strategy, instead of seeing the indicator names I see "Plot0, Plot1, and Plot2". Why are the plot names correct and showing when placed on the chart, but not visible when using the very same indicator in a strategy? Do I need to name the plots somewhere else beside in the plot statement?
    DaveN

    #2
    DaveN, please copy in your properties section - you would normally see something like this -

    Code:
     
    public DataSeries MyPlotName
    {
    get { return Values[0]; }
    }

    Comment


      #3
      Indicator-Strategy naming problem.

      This is what is in there now. In the initialize section I have these plot statements:

      Code:
      Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Bar, "Shrt_VR"));
                  Add(new Plot(Color.FromKnownColor(KnownColor.Blue), PlotStyle.Line, "Long_VR"));
      			Add(new Plot(new Pen(Color.DarkGoldenrod, 2), PlotStyle.Line, "Diff"));
      In the properties region I have:

      Code:
              #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 Plot0
              {
                  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 Plot1
              {
                  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 Plot2
              {
                  get { return Values[2]; }
              }
      Can I simply give the name to the corresponding properties area from the plot in the plot statement? In other words rename plot0 to "Short_VR" and so on?
      Thanks
      DaveN
      Last edited by daven; 01-05-2010, 11:51 AM. Reason: Forgot to add Title to Post

      Comment


        #4
        Correct, exactly this will solve the issue DaveN.

        Comment


          #5
          Indicator-Strategy Name Problem

          That didn't work at all. Now I'm getting error messages for Plot0 to Plot2 not existing in the current context, and when I rename everything to the Shrt_VR or Long_VR, I get error messages indicating NinjaTrader.Indicator.PT_VolRatio does not contain a definition for Plot0.

          Somehow I have to tie the Plot0 through Plot2 plot statements to a dataseries that is named Long_VR, Short_VR, and Diff. Do I create a dataseries with that name first, then define it, then plot it using a plot statement? As near as I can tell, the data series or plot statement values come from the Value0, Value1 etc. statements in the Properties section and I can't see how to tie one to the other.

          Have you got an example of how this is done in a piece of sample code?

          Thanks
          DaveN

          Comment


            #6
            You can look at the AD indicator from us for example -

            Code:
             
            Initialize() -
             
            Add(new Plot(Color.Green, PlotStyle.Line, "AD"));
             
            OnBarUpdate() -
             
            AD.Set(....)
             
            Properties() -
             
            public DataSeries AD
            {
            get { return Values[0]; }
            }

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X