Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Opening and Last Close

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

    #31
    Hi Occam,

    I'm sorry - I don't follow.

    If you're using CurrentDayOHL in an indicator, it needs to be applied to an intraday series. Your steps indicated you applied this to a daily series.

    Have you changed the series for this indicator to intraday (60 minute)? What are your results?
    Ryan M.NinjaTrader Customer Service

    Comment


      #32
      I know I am getting confused myself. I have an indicator that, among other things, uses a daily moving average of the highs and the current day's open price. So through the day these inputs should be static, but I have not sorted out how to get these values in code yet.

      Comment


        #33
        It sounds like your indicator requires multiple series. I would get the values you expect for each component independently, in two separate indicators, and then work on creating a multiseries indicator from this.
        Ryan M.NinjaTrader Customer Service

        Comment


          #34
          How do I access the day's open in code?

          Comment


            #35
            Hi occam, you can use the CurrentDayOHL indicator for this task - http://www.ninjatrader-support.com/H...entDayOHL.html

            Comment


              #36
              I am using Print(CurrentDayOHL().CurrentOpen[0].ToString()); and I get a number that keeps changing through the day.

              Comment


                #37
                Which chart and provider are you working on? Are you sure you're checking the value for the last Day and not the historical values for the other days?

                Please compare directly to the indicator value when it's plotting on your chart.

                Comment


                  #38
                  I am using DTN IQ.

                  I am not doing any charting.

                  Comment


                    #39
                    Hi Occam,

                    Charting is useful to compare values and see visually what is happening.

                    Please post some screenshots of your setup including the column configuration for your indicator.
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #40
                      namespace NinjaTrader.Indicator
                      {
                      public class Key : Indicator
                      {

                      protected override void Initialize()
                      {
                      Add(PeriodType.Day, 1);
                      Add(new Plot(Color.FromKnownColor(KnownColor.MediumAquamar ine), PlotStyle.Line, "Key1"));
                      Overlay = false;
                      CalculateOnBarClose = true;
                      }

                      protected override void OnBarUpdate()
                      {
                      double f1 = CurrentDayOHL().CurrentOpen[0];

                      Print(Instrument.FullName.ToString());
                      Print(CurrentDayOHL().CurrentOpen[0].ToString());

                      Print(f1.ToString());



                      Key1.Set(f1);
                      }

                      }
                      }


                      Column values for indicator
                      Last
                      Day
                      1
                      50
                      False
                      White
                      Black
                      Key
                      TwoHundredFiftySix
                      False
                      Regular
                      Key
                      Data Series
                      Key1
                      Close
                      No
                      No
                      No

                      Comment


                        #41
                        From the looks of it you still have this indicator applied to a daily series.

                        Please see my screenshot and set it up like this.
                        Attached Files
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #42
                          No good.

                          It reports MSFT's open as 25.12 but it opened at 24.59

                          Comment


                            #43
                            What does a chart look like with the same indicator, series, and session template applied?
                            Ryan M.NinjaTrader Customer Service

                            Comment


                              #44
                              Lets try a different approach. How would you access the opening 24.59 for MSFT in code?

                              Is it even possible in NT?

                              Comment


                                #45
                                We can't help you get a specific number.

                                First- look at your MSFT chart on daily to see what NinjaTrader displays.

                                If you want this value programatically - It's Open[0] with CalculateOnBarClose = false, on a daily series.
                                Ryan M.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                605 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                351 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                105 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                560 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                561 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X