v13
- 'BreakOfSrructure()' and 'ChanfeOfCharacter()' now returns a boolean saying if it happened or not.
- Remove obsolete 'Source', the library now always use close value.
- Remove 'ChanfeOfCharacterBreakBarIndex'
Updated:
Create(type, length, equalPivotsFactor, extendEqualPivotsZones, equalPivotsStyle, equalPivotsColor)
Call on each bar. Will create a Structure object.
Parameters:
type (int): the type of the Structure to create. 0 = internal, 1 = swing.
length (int): The lenghts (left and right) for pivots to use.
equalPivotsFactor (float): Set how the limits are for an equal pivot. This is a factor of the Average True Length (ATR) of length 14. If a low pivot is considered to be equal if it doesn't break the low pivot (is at a lower value) and is inside the previous low pivot + this limit.
extendEqualPivotsZones (bool): Set to true if you want the equal pivots zones to be extended.
equalPivotsStyle (string): Set the style of equal pivot zones.
equalPivotsColor (color): Set the color of equal pivot zones.
Returns: The 'structure' object.
BreakOfStructure(structure)
Will create lines when a break of strycture occures.
Parameters:
structure (Structure)
Returns: A boolean that represents if a break of structure was found or not.
ChangeOfCharacter(structure)
Will create lines when a change of character occures. This line will have a label with "CHoCH" or "CHoCH+".
Parameters:
structure (Structure)
Returns: A boolean that represents if a change of character was found or not.
Pivot
Holds all the values for a found pivot.
Fields:
Price (series float): The price of the pivot.
BarIndex (series int): The bar_index where the pivot occured.
Type (series int): The type of the pivot (-1 = low, 1 = high).
BreakOfStructureBroken (series bool): Sets to true if a break of structure has happened.
LiquidityBroken (series bool): Sets to true if a liquidity of the price level has happened.
Structure
Holds all the values for the market structure.
Fields:
Length (series int): Define the left and right lengths of the pivots used.
Type (series int): Set the type of the market structure. Two types can be used, 'internal' and 'swing' (0 = internal, 1 = swing).
Trend (series int): This will be set internally and can be -1 = downtrend, 1 = uptrend.
EqualPivotsFactor (series float): Set how the limits are for an equal pivot. This is a factor of the Average True Length (ATR) of length 14. If a low pivot is considered to be equal if it doesn't break the low pivot (is at a lower value) and is inside the previous low pivot + this limit.
ExtendEqualPivotsZones (series bool): Set to true if you want the equal pivots zones to be extended.
ExtendEqualPivotsStyle (series string): Set the style of equal pivot zones.
ExtendEqualPivotsColor (series color): Set the color of equal pivot zones.
EqualHighs (array<box>): Holds the boxes for zones that contains equal highs.
EqualLows (array<box>): Holds the boxes for zones that contains equal lows.
BreakOfStructures (array<StructureBreak>): Holds all the break of structures within the trend (before a change of character).
Pivots (array<Pivot>): All the pivots in the current trend, added with the latest first, this is cleared when the trend changes.