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

curetn day low

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

    curetn day low

    I am trying to get the current low of day using - High = CurrentDayOHL().CurrentHigh[0];
    or current low - Low = CurrentDayOHL().CurrentLow[0]; using a 15 minute chart.

    I am having an issue because it is picking up the low or high of the previous day at 12:00 when the low and high is reset. One a lower low or higher high is established for the day it is fine.

    What is my workaround to this issue?

    #2
    Originally posted by ct View Post
    I am trying to get the current low of day using - High = CurrentDayOHL().CurrentHigh[0];
    or current low - Low = CurrentDayOHL().CurrentLow[0]; using a 15 minute chart.

    I am having an issue because it is picking up the low or high of the previous day at 12:00 when the low and high is reset. One a lower low or higher high is established for the day it is fine.

    What is my workaround to this issue?
    Use a session template that matches the hours for which you want to see the DayHigh/DayLow.

    Comment


      #3
      Hello CT,

      It will use your session template boundaries to determine if it should start creating new highs and lows. This is a built in indicator, so it may be worthwhile to just apply it to your chart and see how it works. You should see something like the attached screenshot.
      Attached Files
      Ryan M.NinjaTrader Customer Service

      Comment


        #4
        Ryan

        Thanks. what should I use as a time range?

        Comment


          #5
          I would use a session template for the times you're looking to display. You can select a session template by right clicking on chart > Data Series.
          RTH is short for Regular Trading Hours (Day session only)
          ETH is short for Electronic Trading Hours. (Day + overnight).

          You can see exactly how the session templates are defined using Tools > Session Manager.
          Last edited by NinjaTrader_RyanM1; 09-27-2011, 02:05 PM.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Ryan

            I was using 24-7. i even created a custom using 12:01 to 12:01. It didn't help.

            Comment


              #7
              If you don't want it to reset at 12:00, use a different session template. I may be misunderstanding the issue. Can you please attach a screenshot of your chart, indicate the session template you're using, and let us know what you're expecting the chart to look like.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Ryan

                can I email the strategy to you. it is pretty simple.

                Comment


                  #9
                  We first need to work through general indicator usage here before looking at any code. It's not yet clear what you are expecting out of CurrentDayOHL. Please try just plotting the indicator and attaching a screenshot of any chart you don't understand.
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Ryan

                    No issue.

                    code snippet:
                    LastHigh = CurrentDayOHL().CurrentHigh[0];
                    LastLow = CurrentDayOHL().CurrentLow[0];
                    if (lastDayOnly)
                    {
                    DrawFibonacciRetracements("My fibonacci retracements ", false,CurrentBar - LowBar, LastLow,CurrentBar - HighBar, LastHigh);
                    }
                    else
                    {
                    DrawFibonacciRetracements("My fibonacci retracements " + BarDate, false,CurrentBar - LowBar, LastLow,CurrentBar - HighBar, LastHigh);
                    }
                    Attached Files
                    Last edited by ct; 09-27-2011, 03:00 PM.

                    Comment


                      #11
                      It looks like the indicator is working fine, and code accessed values should work the same. Unfortunately we cannot debug this code snippet for you but it looks like you may be drawing this fib object on the last bar of the previous session.

                      You will need to simplify the custom elements until it works as you expect. Attached is a basic script that draws the values for these indicators, and they should be correct for the current day.
                      Attached Files
                      Ryan M.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by algospoke, Yesterday, 06:40 PM
                      2 responses
                      23 views
                      0 likes
                      Last Post algospoke  
                      Started by ghoul, Today, 06:02 PM
                      3 responses
                      14 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by jeronymite, 04-12-2024, 04:26 PM
                      3 responses
                      45 views
                      0 likes
                      Last Post jeronymite  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      7 responses
                      22 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by AttiM, 02-14-2024, 05:20 PM
                      10 responses
                      181 views
                      0 likes
                      Last Post jeronymite  
                      Working...
                      X