PINE LIBRARY

PriceAction

270
Library "PriceAction"
Will draw out the market structure for the disired pivot length.

SetBarIndices(pivotHigh, pivotLow)
  Sets the 'BarIndex' value of the 'Pivot' object. Useful if the pivot is from an other timeframe.
  Parameters:
    pivotHigh (Pivot): The 'Pivot' object for the high pivot.
    pivotLow (Pivot): The 'Pivot' object for the low pivot.

Alert(turtleSoupsContext, settings)
  Will fire off an alert if there is one. To be used lastly in the calling script.
  Parameters:
    turtleSoupsContext (TurtleSoups): The context of all turtle soups.
    settings (TurtleSoupSettings): The settings for turtle soups.

VisualizeTurtleSoups(pivots, turtleSoups, turtleSoupsContext, settings)
  Will visulize found turtle soups and add alert messages for it.
  Parameters:
    pivots (array<Pivot>): All current pivots (high or low).
    turtleSoups (array<TurtleSoup>): All bullish or bearish turtle soups.
    turtleSoupsContext (TurtleSoups): The context of all turtle soups.
    settings (TurtleSoupSettings): The settings for turtle soups.

GetPivots(settings)
  Will get available pivots. Can be called from another timeframe.
  Parameters:
    settings (TurtleSoupSettings): The settings for turtle soups.
  Returns: A tuple of high and then low pivots.

SetPivots(turtleSoupsContext, settings, pivotHigh, pivotLow)
  Will set the new pivots in turtleSoupsContext.
  Parameters:
    turtleSoupsContext (TurtleSoups): The context of all turtle soups.
    settings (TurtleSoupSettings): The settings for turtle soups.
    pivotHigh (Pivot): The 'Pivot' object for the high pivot.
    pivotLow (Pivot): The 'Pivot' object for the low pivot.

Confirm(turtleSoups, turtleSoupsContext, settings, previousStructureBreakBarIndex, screener)
  Will visualize turtle soups. To be called if 'TurtleSoupSettings.Confirmation' is true.
  Parameters:
    turtleSoups (array<TurtleSoup>): All bullish or bearish turtle soups.
    turtleSoupsContext (TurtleSoups): The context of all turtle soups.
    settings (TurtleSoupSettings): The settings for turtle soups.
    previousStructureBreakBarIndex (int): The bar index of the previous structure break (BOS/CHoCH/CHoCH+).
    screener (Screener): The 'Screener' object to be used for Pine Screening by Tradingview. The function will set 'TurtleSoupUntilBarIndex' if there's a confirmed turtle soup.

Liqudity(liquidity)
  Will draw liquidity.
  Parameters:
    liquidity (Liquidity): The 'PriceAction.Liquidity' object.

Pivot(structure)
  Sets the pivots in the structure.
  Parameters:
    structure (Structure)

PivotLabels(structure)
  Draws labels for the pivots found.
  Parameters:
    structure (Structure)

EqualHighOrLow(structure)
  Draws the boxes for equal highs/lows. Also creates labels for the pivots included.
  Parameters:
    structure (Structure)

BreakOfStructure(structure)
  Will create lines when a break of strycture occures.
  Parameters:
    structure (Structure)
  Returns: The 'Pivot' that caused the break of structure, na otherwise.

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: The 'Pivot' that caused the change of character, na otherwise.

VisualizeCurrent(structure)
  Will create a box with a background for between the latest high and low pivots. This can be used as the current trading range (if the pivots broke strucure somehow).
  Parameters:
    structure (Structure)

StructureBreak
  Holds drawings for a structure break.
  Fields:
    Line (series line): The line object.
    Label (series label): The label object.

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).
    Time (series int): The time where the pivot occured.
    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.
    ChangeOfCharacterBroken (series bool): Sets to true if a change of character has happened.

Structure
  Holds all the values for the market structure.
  Fields:
    LeftLength (series int): Define the left length of the pivots used.
    RightLength (series int): Define the right length of the pivots used.
    Type (series Type): 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.
    FontSize (series int): Holds the size of the font displayed.
    AlertChangeOfCharacter (series bool): Holds true or false if a change of character should be alerted or not.
    AlertBreakOfStructure (series bool): Holds true or false if a break of structure should be alerted or not.
    AlerEqualPivots (series bool): Holds true or false if equal highs/lows should be alerted or not.

Liquidity
  Holds all the values for liquidity.
  Fields:
    LiquidityPivotsHigh (array<Pivot>): All high pivots for liquidity.
    LiquidityPivotsLow (array<Pivot>): All low pivots for liquidity.
    LiquidityConfirmationBars (series int): The number of bars to confirm that a liquidity is valid.
    LiquidityPivotsLookback (series int): A number of pivots to look back for.
    FontSize (series int): Holds the size of the font displayed.

PriceAction
  Holds all the values for the general price action and the market structures.
  Fields:
    Liquidity (Liquidity)
    Swing (Structure): Placeholder for all objects used for the swing market structure.
    Internal (Structure): Placeholder for all objects used for the internal market structure.

TurtleSoupSettings
  Holds sll the values for the settings for turtle soups.
  Fields:
    PivotLeftLenght (series int): Define the left length of the pivots used.
    PivotRightLenght (series int): Define the right length of the pivots used.
    Lookback (series int): Set how many pivots back that will be used.
    Confirmation (series bool): Set if you want confirmation to be needed for q turtle soup to be formed (e g. a CHoCH).
    Color (series color): The color of turtle soups.
    ScreenerKeep (series int): Set the number of bars that the plot 'Turtle soup' will have a value after a turtle soup is found.
    AlertFrequency (series string): Set the frequency of alerts, possible values are 'alert.freq_all', 'alert.freq_once_per_bar' or 'alert.freq_once_per_bar_close'.

TurtleSoup
  To be used when a turtle soup is found and holds all values needed for it.
  Fields:
    Line (series line): The line object between the pivot and the turtle soup.
    Box (series box): The bos for the turtle soup.
    Start (series int): The first bar of the turtle soup.
    End (series int): The last bar of the turtle soup.
    Pivot (Pivot): The pivot which liquidity was taken by the turtle soup.

Screener
  Holds all values to be used in the Pine Screener by Tradingview.
  Fields:
    TurtleSoupUntilBarIndex (series int): Pine Screener value for turtle soups.

TurtleSoups
  TurtleSoups The entire context for all turtle soups.
  Fields:
    Highs (array<Pivot>): The high pivots.
    Lows (array<Pivot>): The low pivots.
    Bullish (array<TurtleSoup>): Bullish turtle soups.
    Bearish (array<TurtleSoup>): Bearish turtle soups.
    AlertMessages (array<string>): All messages for the current iteration.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.