Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

do not plot value

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

    do not plot value

    I created a value of +1 and -1 depending upon the color of a bar. The problem is that it screws up the scale because it plots the value of 1 or -1.

    How do I not get the value to plot? here is some of my code to see where I am going wrong.

    protectedoverridevoid Initialize()
    {
    Input = Median;
    Add(
    new Plot(Color.Green, PlotStyle.Hash, "UpTrend"));
    Add(
    new Plot(Color.Red, PlotStyle.Hash, "DownTrend"));
    Add(
    new Plot(Color.Red, PlotStyle.Hash, "buysellTrend")); // +1 uptrend / -1 downtrend
    CalculateOnBarClose = true;
    .....
    .....
    #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 buysellTrend
    {
    get { return Values[2]; }
    }

    Thanks
    Attached Files
    Last edited by velocity; 05-30-2009, 09:20 PM.

    #2
    Somewhere in your code you are setting values to your plots, such as:

    UpTrend.Set(value);

    How about setting the indicator parameter "Auto scale" to false when adding the indicator to your chart?
    RayNinjaTrader Customer Service

    Comment


      #3
      Velocity,

      If your intention is to have a DataSeries that is accessible for a strategy or other indicator (Signal -1: short, Signal 1: long), then you can do it without a Plot. Just do:

      #variables
      private DataSeries signal;

      #init
      signal = new DataSeries(this);

      #onbarupdate
      Signal.Set(1); // long
      Signal.Set(-1); // short

      #parms
      public DataSeries Signal
      {
      get { return signal; }
      }


      Alternatively, you can do as Ray suggests and set auto scale to false, it will solve the problem as well.

      Mike

      Comment


        #4
        thansk guys, that solved it.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sjsj2732, Yesterday, 04:31 AM
        0 responses
        33 views
        0 likes
        Last Post sjsj2732  
        Started by NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        286 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        284 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        133 views
        1 like
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        91 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Working...
        X