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 memonic, Yesterday, 01:23 PM
      2 responses
      11 views
      0 likes
      Last Post memonic
      by memonic
       
      Started by merc410, Today, 03:41 AM
      2 responses
      9 views
      0 likes
      Last Post merc410
      by merc410
       
      Started by sugalt, 04-30-2024, 04:02 AM
      2 responses
      13 views
      0 likes
      Last Post sugalt
      by sugalt
       
      Started by Ndakotan1313, 03-14-2024, 05:02 PM
      2 responses
      62 views
      0 likes
      Last Post blaise_code  
      Started by claxxical, 05-30-2017, 12:30 PM
      37 responses
      4,461 views
      0 likes
      Last Post Padan
      by Padan
       
      Working...
      X