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

Live plots, using Daily HLC values

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

    Live plots, using Daily HLC values

    I was wondering if someone could help me understand how to use Ninja for the following:

    I want to plot the live daily pivot (i.e. H+L+C / 3 )
    The current day's high + current day's low + today's last ) / 3

    and static daily pivot (i.e. H+L+C / 3 )
    The previous days high + previous days low + previous days close) / 3

    This needs to plot on an intra-day volume chart...

    Here is what I have thus far please.

    Code:
     protected override void OnBarUpdate()
            {
           if (Bars == null)
                    return; 
    
    pivotLIVE            = (CurrentDayOHL().CurrentHigh[0] + 
    CurrentDayOHL().CurrentLow[0] + Close[0] ) / 3;
    
    pivotPREVIOUS            = (Bars.GetDayBar(1).High + 
    Bars.GetDayBar(1).Low + Bars.GetDayBar(1).Close ) / 3;

    #2
    Hello tradethebonds,

    For the previous days plot you may want to use the PriorDayOHLC() indicator for those values for example:

    Code:
    if(PriorDayOHLC().PriorHigh[0] != 0 || PriorDayOHLC().PriorLow[0] != 0 || PriorDayOHLC().PriorClose[0] != 0)
    		pivotPREVIOUS    = ((PriorDayOHLC().PriorHigh[0] + PriorDayOHLC().PriorLow[0] + PriorDayOHLC().PriorClose[0]) / 3);
    JCNinjaTrader Customer Service

    Comment


      #3
      Thank u very much! Waz exactly the help I needed.

      Plz...one other question.

      Since I am using CQG for my data...and the Daily data is messed up...

      I have to use a 1440 minute chart to get correct highs & lows...

      How can I use Ninja to call up the correct PriorDayOHLC ?

      I wanted to plot this indy on a volume chart?

      Any ideas plz.?
      Last edited by tradethebonds; 12-27-2013, 09:53 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by reynoldsn, Today, 04:40 PM
      0 responses
      4 views
      0 likes
      Last Post reynoldsn  
      Started by Philippe56140, 04-27-2024, 02:35 PM
      6 responses
      54 views
      0 likes
      Last Post bltdavid  
      Started by ETFVoyageur, Yesterday, 06:05 PM
      7 responses
      45 views
      0 likes
      Last Post ETFVoyageur  
      Started by betsuni_123, Today, 04:20 PM
      0 responses
      11 views
      0 likes
      Last Post betsuni_123  
      Started by Aquila_Welokk, 04-29-2024, 01:14 PM
      2 responses
      22 views
      0 likes
      Last Post Aquila_Welokk  
      Working...
      X