TO INSTALL:-

 1. Copy LibSSSRv2.mq4 to your experts\libraries folder
 
 2. Copy LibSSSRv2.mqh to your experts\include folder
 
 3. Open LibSSSRv2.mq4 in MetaEditor and compile it.

 4. Optionally, copy LibSSSR_EA_Sample.mq4 to your experts folder

 5. Open LibSSSR_EA_Sample.mq4 in MetaEditor and compile it, or restart MT4.  You can then
    attach it to a chart to verify that the library is working correctly.


TO USE IN YOUR EAs/INDICATORs:-

 1. Add #include <LibSSSRv2.mqh> to the top of your EA.

 2. In your EA's init() function, add a call to SSSR_Settings() with your preferred values
    for how the library should calculate S/R levels.  These should be the same as your
    settings for the SS_SupportResistance_vX indicator.

 3. In the EA's start() function add a call where appropriate to SSSR_UpdateZones().  The 
    function's arguments are as follows:-
 
    checkNewCandle - if true, the library will only update zones if it detects that a new
                     candle has formed since it was last called.  This is ignored if a
                     different symbol or period are passed to the function.

    symbol         - Can be NULL or Symbol() if using the chart the EA/indicator's running
                     on, else can be any other valid pair symbol.

    timeframe      - 0 for the current chart's timeframe, else another valid timeframe.

 4. Where required to in your EA, call SSSR_FindZoneV2() with the following arguments:-

    direction     - must be either SSSR_UP or SSSR_DN.  If SSSR_UP it looks for the nearest
                    resistance zone, SSSR_DN it'll look for a support zone.

    useWeak       - specifies whether or not to find "weak" zones or to ignore them.

    price         - this can be anything you want.  The current market price is an obvious usage,
                    to find nearest zones for entries etc, but you're not restricted to that.
   
    hi            - A variable that the function will set to the high side of the zone.
   
    lo            - A variable that the function will set to the low side of the zone.
   
    strength      - A variable that the function will set to the strength of the zone.

    SSSR_FindZoneV2() will return the ID number of a zone, else -1 if it doesn't find one.

    Alternately, you may call SSSR_FindZone() with only direction, useWeak and price, then
    call SSSR_GetZoneHi(), SSSR_GetZoneLo() and SSSR_GetZoneStrength() to retrieve information
    about a zone.  These functions are preserved from version 1, but you should probably call
    SSSR_FindZoneV2() instead, its simpler!

    Also new in V2 of the library, both FindZone functions will check to see if the price is
    inside a zone.  If it is, it will check the type of zone, support or resistance.  If the
    direction you passed in is SSSR_UP and you're in a resistance zone, this zone will be returned.
    If you're in a Support zone however, it'll look for the next higher zone.  The inverse is
    true if you passed in SSSR_DN.

 5. As of version 3 you can also call SSSR_FindFractal() with the following arguments:-

    direction     - can be SSSR_UP for up fractals, SSSR_DN, or SSSR_NONE to get the latest
                    fractal regardless of direction.

    type          - SSSR_FAST or SSSR_SLOW to choose which of the fractal types you want to find.

    limit         - by default set to 1000, its the maximum number of candles the function will
                    search through in order to find the desired fractal.
   
    shift         - If 0, it will start looking from the current candle going back until it finds
                    a fractal matching your criteria.  You can specify a higher number to make
                    it start searching from further back in the pair's history

    count         - If 0, it will return the first fractal it finds.  If 1, it'll ignore the 
                    first fractal, if 2 it'll ignore the first 2 fractals, and so on.
   
    SSSR_FindFractal() will return the index of the fractal's candle, or -1 if it fails to
    find anything.


 That's all you need.  All other functions within the library are for its own internal use, and
 you don't need to know about them or call them from your own code.

 Lastly this library is released under the terms of the GNU General Public License (GPL) version
 2.0.  Under the GPL's terms if you distribute any EA or indicator that uses this library, you 
 must also distribute, free of charge, the sourcecode for your EA/indicator.  If you'd like an
 exemption from the license you need to contact me for a commercial license.  If you just want
 to say thanks & are feeling generous, small paypal donations to andrewsumner@yahoo.com are
 always welcome.

 Good luck and happy pipping!

 cheers,
 Andrew.

