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

highestHigh, lowestLow

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

    highestHigh, lowestLow

    hello,

    I would like to calculate the highest and the lowest in a slice of time.
    I use this formula.

    startDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, StartHour, StartMinute, 0);
    endDateTime = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, EndHour, EndMinute, 0);
    int startBarsAgo = GetBar(startDateTime);
    int endBarsAgo = GetBar(endDateTime);

    Now, if I set the property default graphic, "session beguins" = 00, session ends "= 00, i use

    double highestHigh = MAX(High, startBarsAgo - endBarsAgo)[endBarsAgo];
    double lowestLow = MIN(Low, startBarsAgo - endBarsAgo)[endBarsAgo];

    it works

    But, if I set the property graphic, "session beguins" = 08, session ends "= 22, French Local Time

    I must use this formula so that it works

    double highestHigh = MAX(High, (startBarsAgo+1) - endBarsAgo)[endBarsAgo];
    double lowestLow = MIN(Low, (startBarsAgo+1) - endBarsAgo)[endBarsAgo];

    can you help me understand

    thank you


    #2
    Hi hegh2000, different session settings may produce different results as data may not be available for proper reference. For an example how get a high / low value for a given time range, please check this link - http://www.ninjatrader-support2.com/...ead.php?t=8600
    BertrandNinjaTrader Customer Service

    Comment


      #3
      is exactly the indicator I use.

      Comment


        #4
        Ok - when I use this for example on a 7500 vol ES chart with inputs of 9:30 to 10:30 (based on MST times on a 24 hr session chart), then the indicator marks correctly the 864.50 low level as well as the 869.50 high level. What inputs do you use in the indicator?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          1. 00h00/ 00h00
          2. 8h00-22h00

          you also notice that if properties are default, I have a pseudo candle at the start
          Attached Files

          Comment


            #6
            hegh2000,

            I do not follow. The screenshots are showing the indicator works exactly as it should. Your parameters are telling the indicator to run from 8AM to 9AM. It marks out exactly the highs/lows from that time frame.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              1. Low = 3087
              2. Low = 3097.50

              Comment


                #8
                Not sure what you are referring to. If you look at the screenshots you posted all of the high/lows are accurate as determined by your indicator parameters of 8AM to 9AM.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  on the second chart, the candle from 8.00 is not taken into account

                  Comment


                    #10
                    I cannot discern anything with your chart being so small. Please use the data box to check the time stamps.
                    Josh P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by bmartz, 03-12-2024, 06:12 AM
                    5 responses
                    32 views
                    0 likes
                    Last Post NinjaTrader_Zachary  
                    Started by Aviram Y, Today, 05:29 AM
                    4 responses
                    12 views
                    0 likes
                    Last Post Aviram Y  
                    Started by algospoke, 04-17-2024, 06:40 PM
                    3 responses
                    28 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by gentlebenthebear, Today, 01:30 AM
                    1 response
                    8 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by cls71, Today, 04:45 AM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Working...
                    X