Identifying Chart Highs & Lows

Discussion in 'Automated Trading' started by futures_shark, Feb 11, 2008.

  1. Is the any generally accepted methods out there for idenitifying highs & lows in live price data?

    There is a swing indicator in Ninjatrader but it really only identifies the swings after the fact , about 5 bars later or whatever setting you are using for the strength of your high.

    I've begun work on my own stuff but I'm keep running into dead ends.
  2. Fozzy


    I'm new to this forum, but I think I know the answer to this one.
    The answer is no. You already have about all that can be done. Consider a sequence of rising bars and, of course, for the moment at least, we are at the top. So how can anyone or anything possibly know whether the next bar will take us up or down? Its not possible to know. Suppose now, that the next bar is a down bar, this represents a small probability that we reached a peak one bar ago. If successive bars go down, the probability increases that we saw a significant high and eventualy, after enough bars have passed, we arrive at what you have in Ninja.
    I sure would love someone to show that I'm wrong, we would then have the Grail.
  3. soverton



    The most relevant indicator I can think of is Donchian Channels. It's nothing complex, but you will always have the problem of identifying the lookback period.

    Appropriate lookback periods usually vary by the chart period. I like looking at high/lows for the past 50 bars on 1 hr charts. 10-55 periods are popular for daily charts.
  4. rosy2


    max( array_of_last_X_bars[] )
    min ( array_of_last_X_bars[] )
  5. the problem is with that code, if the market is moving in one direction during those x bars the identified high or low will not appear to be a high or low on a chart
  6. Hi,

    Here is a simple way to Plot Highs and Lows of a Chart in Live or EOD data.

    It plots as soon as the Bar is complete or you can make it INtrabar also as NewHigh/New Low is found (by removing bar status).

    The code is in TradeStation Easylanguage.


    	nH(-999999), nL(999999);
    if (BarStatus(1)=2) then
    if (High > nH) then
    	nH= High;
    if (Low < nL) then
    	nL = Low;
    	Plot1(nH, "New High");
    	Plot2(nL, "New Low");

    <img src="">

  7. the circled interim highs are what I am trying to identify.
  8. You could try this with Highest(High, nBars)... Based on your specific condition you could tailor it to show nBar High/Lows.


    	nH(0), nL(0);
    if (BarStatus(1)=2) then
    	nH = Highest(High,NBars);
    	nL = Lowest(Low,nBars);
    	if (nH = High) then
    		Plot1(NH, "New High");
    	if (nL = Low) then
    		Plot2(NL, "New Low");

    <img src="">

  9. thrunner


    You are trying to find peaks and troughs in real time, which can't be done with pure price action.
  10. Every single indicator out there is equivalent to a moving average (just the reader differ, but no new information)
    #10     Mar 8, 2008