Library "ReversalChartPatternLibrary"
User Defined Types and Methods for reversal chart patterns - Double Top, Double Bottom, Triple Top, Triple Bottom, Cup and Handle, Inverted Cup and Handle, Head and Shoulders, Inverse Head and Shoulders
method delete(this)
Deletes the drawing components of ReversalChartPatternDrawing object
Namespace types: ReversalChartPatternDrawing
Parameters:
this (ReversalChartPatternDrawing): ReversalChartPatternDrawing object
Returns: current ReversalChartPatternDrawing object
method delete(this)
Deletes the drawing components of ReversalChartPattern object. In turn calls the delete of ReversalChartPatternDrawing
Namespace types: ReversalChartPattern
Parameters:
this (ReversalChartPattern): ReversalChartPattern object
Returns: current ReversalChartPattern object
method lpush(this, obj, limit, deleteOld)
Array push with limited number of items in the array. Old items are deleted when new one comes and exceeds the limit
Namespace types: ReversalChartPattern[]
Parameters:
this (ReversalChartPattern[]): array<ReversalChartPattern> object
obj (ReversalChartPattern): ReversalChartPattern object which need to be pushed to the array
limit (int): max items on the array. Default is 10
deleteOld (bool): If set to true, also deletes the drawing objects. If not, the drawing objects are kept but the pattern object is removed from array. Default is false.
Returns: current ReversalChartPattern object
method draw(this)
Draws the components of ReversalChartPatternDrawing
Namespace types: ReversalChartPatternDrawing
Parameters:
this (ReversalChartPatternDrawing): ReversalChartPatternDrawing object
Returns: current ReversalChartPatternDrawing object
method draw(this)
Draws the components of ReversalChartPatternDrawing within the ReversalChartPattern object.
Namespace types: ReversalChartPattern
Parameters:
this (ReversalChartPattern): ReversalChartPattern object
Returns: current ReversalChartPattern object
method scan(zigzag, patterns, errorPercent, shoulderStart, shoulderEnd)
Scans zigzag for ReversalChartPattern occurences
Namespace types: zg.Zigzag
Parameters:
zigzag (Zigzag type from HeWhoMustNotBeNamed/ZigzagTypes/2): ZigzagTypes.Zigzag object having array of zigzag pivots and other information on each pivots
patterns (ReversalChartPattern[]): Existing patterns array. Used for validating duplicates
errorPercent (float): Error threshold for considering ratios. Default is 13
shoulderStart (float): Starting range of shoulder ratio. Used for identifying shoulders, handles and necklines
shoulderEnd (float): Ending range of shoulder ratio. Used for identifying shoulders, handles and necklines
Returns: int pattern type
method createPattern(zigzag, patternType, patternColor, riskAdjustment)
Create Pattern from ZigzagTypes.Zigzag object
Namespace types: zg.Zigzag
Parameters:
zigzag (Zigzag type from HeWhoMustNotBeNamed/ZigzagTypes/2): ZigzagTypes.Zigzag object having array of zigzag pivots and other information on each pivots
patternType (int): Type of pattern being created. 1 - Double Tap, 2 - Triple Tap, 3 - Cup and Handle, 4 - Head and Shoulders
patternColor (color): Color in which the patterns are drawn
riskAdjustment (float): Used for calculating stops
Returns: ReversalChartPattern object created
method getName(this)
get pattern name of ReversalChartPattern object
Namespace types: ReversalChartPattern
Parameters:
this (ReversalChartPattern): ReversalChartPattern object
Returns: string name of the pattern
method getDescription(this)
get consolidated description of ReversalChartPattern object
Namespace types: ReversalChartPattern
Parameters:
this (ReversalChartPattern): ReversalChartPattern object
Returns: string consolidated description
method init(this)
initializes the ReversalChartPattern object and creates sub object types
Namespace types: ReversalChartPattern
Parameters:
this (ReversalChartPattern): ReversalChartPattern object
Returns: ReversalChartPattern current object
ReversalChartPatternDrawing
Type which holds the drawing objects for Reversal Chart Pattern Types
Fields:
patternLines (Line[] type from HeWhoMustNotBeNamed/DrawingTypes/1): array of Line objects representing pattern
entry (Line type from HeWhoMustNotBeNamed/DrawingTypes/1): Entry price Line
target (Line type from HeWhoMustNotBeNamed/DrawingTypes/1): Target price Line
patternLabel (Label type from HeWhoMustNotBeNamed/DrawingTypes/1)
ReversalChartPattern
Reversal Chart Pattern master type which holds the pattern components, drawings and trade details
Fields:
pivots (Pivot[] type from HeWhoMustNotBeNamed/ZigzagTypes/2): Array of Zigzag Pivots forming the pattern
patternType (series int): Defines the main type of pattern 1 - Double Tap, 1 - Triple Tap, 3 - Cup and Handle, 4 - Head and Shoulders
patternColor (series color): Color in which the pattern will be drawn on chart
riskAdjustment (series float): Percentage adjustment of risk. Used for setting stops
drawing (ReversalChartPatternDrawing): ReversalChartPatternDrawing object which holds the drawing components
trade (Trade type from HeWhoMustNotBeNamed/TradeTracker/1): TradeTracker.Trade object holding trade components