PINE LIBRARY
Zaktualizowano

tts_convention

1 428
Library "tts_convention"
This library can convert the start, end, cancel start, cancel end deal conditions that are used in the
"Template Trailing Strategy" script into a signal value and vice versa. The "two channels mod div" convention is unsed
internaly and the signal value can be composed/decomposed into two channels that contain the afforementioned actions
for long and short positions separetely.

getDealConditions(signal)
  getDealConditions - Get the start, end, cancel start and cancel end deal conditions that are used in the "Template Trailing Strategy" script by decomposing the given signal
  Parameters:
    signal (int): - The signal value to decompose
  Returns: An object with the start, end, cancel start and cancel end deal conditions for long and short

getSignal(dealConditions)
  getSignal - Get the signal value from the composition of the start, end, cancel start and cancel end deal conditions that are used in the "Template Trailing Strategy" script
  Parameters:
    dealConditions (DealConditions): - The deal conditions object that containd the start, end, cancel start and cancel end deal conditions for long and short
  Returns: The composed signal value

DealConditions
  Fields:
    startLongDeal (series__bool)
    startShortDeal (series__bool)
    endLongDeal (series__bool)
    endShortDeal (series__bool)
    cnlStartLongDeal (series__bool)
    cnlStartShortDeal (series__bool)
    cnlEndLongDeal (series__bool)
    cnlEndShortDeal (series__bool)
Informacje o Wersji
v2
minor improvement use constants instead of literals
Informacje o Wersji
v3
Minor typo and documentation changes
Informacje o Wersji
v4
Added some documentation
Informacje o Wersji
v5
  • Some minor optimizations using `const` variables where it was possible
  • Update signal_datagram library
Informacje o Wersji
v6
  • Added version check functionality on handshake
  • Added examples at the end of the script on how to produce and consume a signal
  • Use enums
  • Update `signal_datagram` libarary
Informacje o Wersji
v7
  • Update to pinescript version 6
  • Changed offset of signals and shapes in the example

Wyłączenie odpowiedzialności

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.