Spot Swing High's / Swing Low's

Discussion in 'Automated Trading' started by croupier, Sep 6, 2010.

  1. croupier


    If you had to describe the red marked Swing High's / Low's to a programmer, what would you say?

    I have existing code that finds most of these points BUT also much more High's and Low's that are not really Swing High's, more just noise in sideways markets.
    Now we could add indicators (Moving Averages etc.) to check if the market is trending or moving sideways and filter some signals. Because the system should be simple and everything an indicator can show is already in price (but not visible that easy) adding indicators is not the prefered way.

    Please note that I am not asking for code or the holy grail.
    I have my own brain, so all I am interested in is your opinion on the initial question.

    Also if you know already existing "indicators" like this for Tradestation or any other platform, please post it here.

    Maybe your inputs will give me a new point to think about. Thanks.


  2. finding swing hi/lo's with help from pivots in el/pl might be easyer when using rangebars, do you have acces to those ?
  3. Hi croupier,

    i need 2 clarifications.

    - Are you interested in 1) "identifying" those points real time, just as data feed arrives (so "future ticks" are unknown), or (2 are you assuming to already have the observed data (descriptive context).
    I guess you are interested in the first one. Right ?

    - What is your "intuitive" definition of "swing high" ? (Describe it in simple words.)

  4. croupier


    Thanks flyingdutchmen, I dont have access to rangebars "out of the box", but this is a custom project written with own code, so I think the access (calculation out of the data feed) should not be the problem. From what I see rangebars are better for the "visual" part. Visual does imho not really matter, as it is my goal to teach an application finding the swing highs / lows.

  5. i think we might misunderstooth eachother, while using rangebars you would have alot less "wrong" signals because many of the small candles wouldnt be there that otherwhise could have been determined to be an failure (or to weak) swing high or low.
    in other words they would have been filtered out. to me a swing high would be
    an formation of at least 3 candles, an high, an higher high and another high which high does not exceed prior high. while using an moving average or the pivot function in el you will have either like you said yourself... to many signals, or you will miss out alot of them because the loockback period is to high. those pivot indikator need time aka bars for comformation/strenght of the pattern.
    what i have done (i did not have acces to range bars either) is dimish the time factor in a normal timeframe chart by calculating "virtual" rangebars of the existing bars in a 1 minute barchart and save them in arrays. i tried to 'neutralize' the timefactor within in a timeframe-chart. from there those values can be used to find pivots aka swings with better accuracy because you will find to have more quality highs and lows to work with. i still should have the code somewhere
  6. croupier


    Hello Tom,

    good questions :)

    I want to identify these points in real time. It is not possible to get an "alert" at the exact high or low point, thats sure. (as an example "a high": price moves up and has to go down to confirm the "high") So the alert (or the entry into the console) comes later, not exactly at the high.

    Definition of a swing high:

    - My swing high is built out of 5 candles. Like this: CCBABCC

    ((Where (A) is the "high", (B) has a lower high than (A), (C) has a lower high than (B)))

    - Each set of 5 candles has a "high" candle (A) (absolute high) OR two candles that have the same absolute high.

    - One candle before or after the absoulte high (B), has to have a lower high than the "high" candle.

    - 2 and 3 candles (C) before or after the Candle (A) must have a lower high than Candle (A) and (B).

    I hope you understand what I mean. I can send you the code part by PM if you wish.

    Now there is also the visual part. A swing high imo is easy visible on a chart and most of the time is built out of maybe up to 10 candles. (otherwise it is a spike) The real beautyful swing highs are like a horizontal half circle.

  7. croupier


    Now I understand your point. I will check this, good one.

    If you find the code, that would be very good!
  8. croupier


    Yes, something like this is what I have done already. As you say, now filtering is the big challenge... I had also things like, "high for the last 200 bars" etc. to get less signals. This helped until some point, but again, you wont believe how many times a high of 200 bars ago occurs in range markets. :D

    If you let an algo run over price data like this, it finds signals where you never even thought there could be one... :)
  9. If "it is not possible to get an "alert" at the exact high", we cannot clearly identify realtime the A.
    Further, since you define the "swing High" formation as a set of candles enclosing the A, it's just "by definition" that you can identify the "swing High" on the last Cs.
    It seems to me you have actually precisely answered yourself to the original question.

    This would imply that the "identification instant" of the candle formation refers to a peak (A) that belongs to a ("close") past.
    The real point, i guess, would be, how the identification of this formation migh be useful in a strategy.
    Probably, it calls for the belief that this so called "swing High" ** might ** be followed by a downward movement.
    So, perhaps, one must be willing to enter the realm of "prediction".

  10. croupier


    Thanks Tom, entry and exit are not based on this calculations. These points are just a part of the system. The system combines these points to possible signals, also with other parameters.

    Maybe the original question should now be, how do you filter these signals, according to my definition? ;)

    Ps. With realtime I meant extracting the signals out of a datafeed. Not that I have a dataset from past market action.
    #10     Sep 6, 2010