plurex

PlurexSignal

plurex Uppdaterad   
Library "PlurexSignal"
Provides functions that wrap the built in TradingView strategy functions so you can seemlessly integrate with Plurex Signal automation.
NOTE: Be sure to set your strategy close_entries_rule="ANY" and pyramiding=20 or some other amount appropriate to your strategy in order to have multiple entries.

plurexMarket()
  Build a Plurex market string from a base and quote asset symbol.
  Returns: A market string that can be used in Plurex Signal messages.

tickerToPlurexMarket()
  Builds Plurex market string from the syminfo
  Returns: A market string that can be used in Plurex Signal messages.

simpleMessage(secret, action, marketOverride)
  Builds Plurex Signal Message json to be sent to a Signal webhook
  Parameters:
    secret: The secret for your Signal on plurex
    action: The action of the message. One of .
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
  Returns: A json string message that can be used in alerts to send messages to Plurex.

long(secret, marketOverride, qty)
  Open a new long entry. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
    qty: Corresponds to strategy.entry qty

short(secret, marketOverride, qty)
  Open a new short entry. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
    qty: Corresponds to strategy.entry qty

closeAll(secret, marketOverride)
  Close all positions. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.

closeLongs(secret, marketOverride)
  Close all longs. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.

closeShorts(secret, marketOverride)
  Close all shorts. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.

closeLastLong(secret, marketOverride)
  Close last long entry. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.

closeFirstLong(secret, marketOverride)
  Close first long entry. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.

closeLastShort(secret, marketOverride)
  Close last short entry. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.

closeFirstShort(secret, marketOverride)
  Close first short entry. Wraps strategy function and sends plurex message as an alert.
  Parameters:
    secret: The secret for your Signal on plurex
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
Versionsinformation:
v2

Added:
longAndSetStopLoss(secret, stop, marketOverride, qty)
  Open a new long entry. Wraps strategy function and sends plurex message as an alert. Also sets a gobal stop loss for full open position
  Parameters:
    secret: The secret for your Signal on plurex
    stop: The trigger price for the stop loss. See strategy.exit documentation
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
    qty: Corresponds to strategy.entry qty

longAndSetTrailingStopLoss(secret, trail_offset, trail_price, trail_points, marketOverride, qty)
  Open a new long entry. Wraps strategy function and sends plurex message as an alert. Also sets a gobal trailing stop loss for full open position. You must set one of trail_price or trail_points.
  Parameters:
    secret: The secret for your Signal on plurex
    trail_offset: See strategy.exit documentation
    trail_price: See strategy.exit documentation
    trail_points: See strategy.exit documentation
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
    qty: Corresponds to strategy.entry qty

shortAndSetStopLoss(secret, stop, marketOverride, qty)
  Open a new short entry. Wraps strategy function and sends plurex message as an alert. Also sets a gobal stop loss for full open position
  Parameters:
    secret: The secret for your Signal on plurex
    stop: The trigger price for the stop loss. See strategy.exit documentation
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
    qty: Corresponds to strategy.entry qty

shortAndSetTrailingStopLoss(secret, trail_offset, trail_price, trail_points, marketOverride, qty)
  Open a new short entry. Wraps strategy function and sends plurex message as an alert. Also sets a gobal trailing stop loss for full open position. You must set one of trail_price or trail_points.
  Parameters:
    secret: The secret for your Signal on plurex
    trail_offset: See strategy.exit documentation
    trail_price: See strategy.exit documentation.
    trail_points: See strategy.exit documentation
    marketOverride: Optional, defaults to the syminfo for the ticker. Use the `plurexMarket` function to build your own.
    qty: Corresponds to strategy.entry qty

Pinebibliotek

I sann TradingView-anda har författaren publicerat denna Pine-kod som ett bibliotek med öppen källkod så att andra Pine-programmerare från vår community kan återanvända den. Hatten av för författaren! Du kan använda det här biblioteket privat eller i andra publikationer med öppen källkod, men återanvändning av den här koden i en publikation regleras av våra ordningsregler.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här biblioteket?

Kopiera följande rad och klistra in det i ditt skript.