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 from another indicator

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

    Plot from another indicator

    From another indicator, I'm calling and plotting the Current High and Low fromt the CurrentDayOHL indicator. Why it is not plotting? Am I using the wrong function/syntax? Thanks in advance.

    Code:
    Protected override void Initialize ()
    {
          Add(new Plot(new Pen(Color.Yellow, 2), PlotStyle.Hash, "Today High"));
          Add(new Plot(new Pen(Color.Yellow, 2), PlotStyle.Hash, "Today Low"));  }
      
    Protected override void OnBarUpdate()
     {
          double TodayHi  =   CurrentDayOHL().CurrentHigh[0];
          double TodayLo  =   CurrentDayOHL().CurrentLow[0];
      }
        #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 TodayHi
              {
                  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 TodayLo
              {
                  get { return Values[1]; }
              }
      #endregion

    #2
    Originally posted by 2Look4me View Post
    From another indicator, I'm calling and plotting the Current High and Low fromt the CurrentDayOHL indicator. Why it is not plotting? Am I using the wrong function/syntax? Thanks in
    You haven't set your plots..

    Look in the code here to see an example

    Comment


      #3
      Hello 2Look4me,

      Thank you for writing in. You would need to actually set the plot values for them to draw on the chart. For example:
      Code:
      protected override void OnBarUpdate()
       {
            double TodayHi  =   CurrentDayOHL().CurrentHigh[0];
            Values[0].Set(TodayHi);
            double TodayLo  =   CurrentDayOHL().CurrentLow[0];
            Values[1].Set(TodayLow);
        }
      Please let me know if I may be of further assistance.
      Michael M.NinjaTrader Quality Assurance

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by WHICKED, Today, 12:45 PM
      2 responses
      18 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by GussJ, 03-04-2020, 03:11 PM
      15 responses
      3,276 views
      0 likes
      Last Post xiinteractive  
      Started by Tim-c, Today, 02:10 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by Taddypole, Today, 02:47 PM
      0 responses
      5 views
      0 likes
      Last Post Taddypole  
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      51 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Working...
      X