• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Identify high and lows

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

    Identify high and lows

    Hey,

    How do I identify previous and future highs and lows in a UniRenkochart
    Because I want to check if the bars are making higher highs and simultanously higher lows and vise versa. Even when it is only a "small" und high/low.

    So I have to check the current state of a new formed high that was established to the previous high and also for lows.

    If this is possible can I also plot a circle shape at this specific high/low and reference exact this Position for further processing?

    Thanks
    Last edited by anmu1990; 11-26-2019, 06:53 AM.

    #2
    Hello anmu1990,

    You could use HighestBar and LowestBar for this type of use case, these methods take a series like the High or Low series and check what the highest/lowest bars were withing a period.

    https://ninjatrader.com/support/help...ghtsub=highest
    https://ninjatrader.com/support/help...tsub=lowestbar

    This returns a BarsAgo which could be used to collect the prices as shown in the examples.


    If you want to actually make a condition checking for the highest high you could do that by creating a variable and checking if the price is higher than the variable, if so reset the variable to the price. Doing this over the period you want to check will accumulate the highest value, the same could be accomplished for the lowest value.

    For plotting I would suggest looking at the help guide here: https://ninjatrader.com/support/help...t8/drawing.htm

    The drawing objects can be used to mark the chart with the prices/BarsAgo found from the methods above.



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hey,

      thank you for your answer. I will have a look on it.

      Furthermore, here a image of what I am searching for.
      + Compare the most recent High/low (dot price) with the previous one to know if it made a higher high and a lower low.

      The problem I see with HighestBar is that I have to define a period. But as you can see if the period is too small and it haven't made a "real" high peak it
      would take the highest price of the bars in the period. E.g. if the price would only fall in the period it takes the first bar with the highest price. but that not what I looking for.

      Your second recommendation could be used I think?
      e.g. if I search for a new established High it would mean that the high of the previous and the following bar is smaller than the bar with the high?
      If this is met I save this price in a "list" and compare it with the new high that will eventually appear with the same condition as mentioned before, right?

      Comment


        #4
        Hello anmu1990,

        Are you just looking for the high/low of the current session or did you want to configure the amount of time that is included in the search?

        For the current high/low of the session you can just use the CurrentOHL indicator: https://ninjatrader.com/support/help...sub=currentday

        If the indicator does not work for the use case an accumulation to variables could likely work.

        e.g. if I search for a new established High it would mean that the high of the previous and the following bar is smaller than the bar with the high?
        You wouldn't need to check any of the previous highs if you are just trying to get the current high. A quick example of what I meant would be:

        Code:
        //variables
        private double myHighPrice = 0; 
        
        
        if(myHighPrice < Close[0])
        {
            myHighPrice = Close[0];
        }
        This just sets a new high price each time the price is higher than what was previously stored. This would accumulate a new highest price from when the logic was run which could include all of historical data loaded.

        Lowest would be the same concept except you would need to define the variable with a high starting value such as the current Close or 9999 to make sure it sets a new lowest value when running.

        If this is met I save this price in a "list" and compare it with the new high that will eventually appear with the same condition as mentioned before, right?
        A list wouldn't be needed, just storing a double variable to make sure the price is the highest. If you wanted to do a comparison over a specific period to get a trend you could just use the close and bars ago:

        Code:
        if(Close[0] > Close[1] && Close[1] > Close[2])

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Benjaminf, Today, 02:21 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by grayfrog, 05-24-2020, 09:29 PM
        4 responses
        30 views
        0 likes
        Last Post natgasguy  
        Started by chrismcdermut, Today, 01:46 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by dpolyakov, Today, 01:13 PM
        3 responses
        14 views
        0 likes
        Last Post dpolyakov  
        Started by tjendra, Today, 12:15 PM
        3 responses
        9 views
        0 likes
        Last Post tjendra
        by tjendra
         
        Working...
        X