PINE LIBRARY
Atualizado PlurexSignal

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 [LONG, SHORT, CLOSE_LONGS, CLOSE_SHORTS, CLOSE_ALL, CLOSE_LAST_LONG, CLOSE_LAST_SHORT, CLOSE_FIRST_LONG, CLOSE_FIRST_SHORT].
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.
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 [LONG, SHORT, CLOSE_LONGS, CLOSE_SHORTS, CLOSE_ALL, CLOSE_LAST_LONG, CLOSE_LAST_SHORT, CLOSE_FIRST_LONG, CLOSE_FIRST_SHORT].
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.
Notas de Lançamento
v2Added:
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
Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Biblioteca do Pine
No verdadeiro espirito do TradingView, o autor desse código Pine o publicou como uma biblioteca de código aberto, para que outros programadores Pine da nossa comunidade possam reusa-los. Parabéns ao autor! Você pode usar essa biblioteca privadamente ou em outras publicações de código aberto, mas a reutilização desse código em publicações é regida pelas Regras da Casa.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.