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

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 f.saeidi, Today, 08:01 PM
        0 responses
        3 views
        0 likes
        Last Post f.saeidi  
        Started by Rapine Heihei, Today, 07:51 PM
        0 responses
        3 views
        0 likes
        Last Post Rapine Heihei  
        Started by frslvr, 04-11-2024, 07:26 AM
        5 responses
        96 views
        1 like
        Last Post caryc123  
        Started by algospoke, 04-17-2024, 06:40 PM
        6 responses
        49 views
        0 likes
        Last Post algospoke  
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Working...
        X