PINE LIBRARY

COMET_Scanner_Library_FINAL

ที่อัปเดต:
Library "COMET_Scanner_Library"
- A Trader's Edge (ATE)_Library was created to assist in constructing COM Scanners

TickerIDs(_string)
  TickerIDs: You must form this single tickerID input string exactly as described in the scripts info panel (little gray 'i' that
is circled at the end of the settings in the settings/input panel that you can hover your cursor over this 'i' to read the
details of that particular input). IF the string is formed correctly then it will break up this single string parameter into
a total of 40 separate strings which will be all of the tickerIDs that the script is using in your COM Scanner.
  Parameters:
    _string (simple string): (string)
A maximum of 40 Tickers (ALL joined as 1 string for the input parameter) that is formulated EXACTLY as described
within the tooltips of the TickerID inputs in my COM Scanner scripts:
assets = input.text_area(tIDs, title="TickerIDs (MUST READ TOOLTIP)", group=g2, tooltip="Accepts 40 TICKERID's
for each copy of the script on the chart. \n\n*** MUST FORMAT THIS WAY ***\n\n Each FULL tickerID
(ie 'Exchange:ticker') must be separated by A SINGLE BLANK SPACE for correct formatting. The blank space tells
the script where to break off the ticker to assign it to a variable to be used later in the script. So this input
will be a single string constructed from up to 40 tickerID's with a space between each tickerID
(ie. 'BINANCE:BTCUSDT BINANCE:SXPUSDT BINANCE:XRPUSDT').", display=display.none)

  Returns: Returns 40 output variables in the tuple (ie. between the '[]') with the separated TickerIDs,

Locations(_firstLocation)
  Locations: This function is used when there's a desire to print an assets ALERT LABELS. A set Location on the scale is assigned to each asset.
This is created so that if a lot of alerts are triggered, they will stay relatively visible and not overlap each other.
If you set your '_firstLocation' parameter as 1, since there are a max of 40 assets that can be scanned, the 1st asset's location
is assigned the value in the '_firstLocation' parameter, the 2nd asset's location is the (1st asset's location+1)...and so on.
  Parameters:
    _firstLocation (simple int): (simple int)
Optional (starts at 1 if no parameter added).
Location that you want the first asset to print its label if is triggered to do so.
ie. loc2=loc1+1, loc3=loc2+1, etc.

  Returns: Returns 40 variables for the locations for alert labels

LabelSize(_barCnt, _lblSzRfrnce)
  INVALID TICKERIDs: This is to add a table in the middle right of your chart that prints all the TickerID's that were either not formulated
correctly in the '_source' input or that is not a valid symbol and should be changed.

LABEL SIZES: This function sizes your Alert Trigger Labels according to the amount of Printed Bars the chart has printed within
a set time period, while also keeping in mind the smallest relative reference size you input in the 'lblSzRfrnceInput'
parameter of this function. A HIGHER % of Printed Bars(aka...more trades occurring for that asset on the exchange),
the LARGER the Name Label will print, potentially showing you the better opportunities on the exchange to avoid
exchange manipulation liquidations.
*** SHOULD NOT be used as size of labels that are your asset Name Labels next to each asset's Line Plot...
if your COM Scanner includes these as you want these to be the same size for every asset so the larger ones dont cover the
smaller ones if the plots are all close to each other ***
  Parameters:
    _barCnt (float): (float)
Get the 1st variable('barCnt') from the Security function's tuple and input it as this functions 1st input
parameter which will directly affect the size of the 2nd output variable ('alertTrigLabel') that is also outputted by this function.

    _lblSzRfrnce (string): (string)
Optional (if parameter not included, it defaults to size.small). This will be the size of the variable outputted
by this function named 'assetNameLabel' BUT also affects the size of the output variable 'alertTrigLabel' as it uses this parameter's size
as the smallest size for 'alertTrigLabel' then uses the '_barCnt' parameter to determine the next sizes up depending on the "_barCnt" value.

  Returns: ([string,string])
Returns 2 variables:
1st output variable ('AssetNameLabel') is assigned to the size of the 'lblSzRfrnceInput' parameter.
2nd output variable('alertTrigLabel') can be of variying sizes depending on the 'barCnt' parameter...BUT the smallest
size possible for the 2nd output variable ('alertTrigLabel') will be the size set in the 'lblSzRfrnceInput' parameter.

InvalidTickerIDs(_close, _securityTickerid, _invalidArray, _tablePosition, _stackVertical)
  Parameters:
    _close (float)
    _securityTickerid (string)
    _invalidArray (array<string>)
    _tablePosition (simple string)
    _stackVertical (simple bool)

PrintedBarCount(_time, _barCntLength, _barCntPercentMin)
  The Printed BarCount Filter looks back a User Defined amount of minutes and calculates the % of bars that have printed
out of the TOTAL amount of bars that COULD HAVE been printed within the same amount of time.
  Parameters:
    _time (int): (int)
The time associated with the chart of the particular asset that is being screened at that point.

    _barCntLength (int): (int)
The amount of time (IN MINUTES) that you want the logic to look back at to calculate the % of bars that have actually
printed in the span of time you input into this parameter.

    _barCntPercentMin (int): (int)
The minimum % of Printed Bars of the asset being screened has to be GREATER than the value set in this parameter
for the output variable 'bc_gtg' to be true.

  Returns: ([float, bool])
Returns 2 outputs:
1st is the % of Printed Bars that have printed within the within the span of time you input in the '_barCntLength' parameter.
2nd is true/false according to if the Printed BarCount % is above the threshold that you input into the '_barCntPercentMin' parameter.
เอกสารเผยแพร่
v2
Messed up on Regex with the tickerID breakdown from the string of tickers.
เอกสารเผยแพร่
v3
เอกสารเผยแพร่
v4

Added:
TickerString(_string, inEachGroup, whichGroup)
  TickerString: This function extracts the string from the entire list of assets you will be scanning.
  Parameters:
    _string (simple string): (string)
This is the entire list of assets you will be scanning.

    inEachGroup (simple int): (int)
How many assets will be in each group for this scanner (hard-coded/set by COMET Scanner Author).

    whichGroup (simple int): (int)
Which set/group of assets that particular iteration/copy of the scanner will be scanning.

  Returns: Returns a string containing all the assets being scanned as determined by the amount of assets in each group and which group of the lot is being scanned.
เอกสารเผยแพร่
v5

Updated:
TickerIDs(_string)
  TickerIDs: You must form this single tickerID input string exactly as described in the scripts info panel (little gray 'i' that
is circled at the end of the settings in the settings/input panel that you can hover your cursor over this 'i' to read the
details of that particular input). IF the string is formed correctly then it will break up this single string parameter into
a total of 40 separate strings which will be all of the tickerIDs that the script is using in your COMET Scanner.
  Parameters:
    _string (simple string): (string)
A maximum of 40 Tickers (ALL joined as 1 string for the input parameter) that is formulated EXACTLY as described
within the tooltips of the TickerID inputs in my COMET Scanner scripts:
assets = input.text_area(tIDs, title="TickerIDs (MUST READ TOOLTIP)", group=g2, tooltip="Accepts 40 TICKERID's
for each copy of the script on the chart. \n\n*** MUST FORMAT THIS WAY ***\n\n Each FULL tickerID
(ie 'Exchange:ticker') must be separated by A SINGLE BLANK SPACE for correct formatting. The blank space tells
the script where to break off the ticker to assign it to a variable to be used later in the script. So this input
will be a single string constructed from up to 40 tickerID's with a space between each tickerID
(ie. 'BINANCE:BTCUSDT BINANCE:SXPUSDT BINANCE:XRPUSDT').", display=display.none)

  Returns: Returns 40 output variables in the tuple (ie. between the '[]') with the separated TickerIDs,

LabelSize(_barCnt, _lblSzRfrnce)
  INVALID TICKERIDs: This is to add a table in the middle right of your chart that prints all the TickerID's that were either not formulated
correctly in the '_source' input or that is not a valid symbol and should be changed.

LABEL SIZES: This function sizes your Alert Trigger Labels according to the amount of Printed Bars the chart has printed within
a set time period, while also keeping in mind the smallest relative reference size you input in the 'lblSzRfrnceInput'
parameter of this function. A HIGHER % of Printed Bars(aka...more trades occurring for that asset on the exchange),
the LARGER the Name Label will print, potentially showing you the better opportunities on the exchange to avoid
exchange manipulation liquidations.
*** SHOULD NOT be used as size of labels that are your asset Name Labels next to each asset's Line Plot...
if your COMET Scanner includes these as you want these to be the same size for every asset so the larger ones dont cover the
smaller ones if the plots are all close to each other ***
  Parameters:
    _barCnt (float): (float)
Get the 1st variable('barCnt') from the Security function's tuple and input it as this functions 1st input
parameter which will directly affect the size of the 2nd output variable ('alertTrigLabel') that is also outputted by this function.

    _lblSzRfrnce (string): (string)
Optional (if parameter not included, it defaults to size.small). This will be the size of the variable outputted
by this function named 'assetNameLabel' BUT also affects the size of the output variable 'alertTrigLabel' as it uses this parameter's size
as the smallest size for 'alertTrigLabel' then uses the '_barCnt' parameter to determine the next sizes up depending on the "_barCnt" value.

  Returns: ([string,string])
Returns 2 variables:
1st output variable ('AssetNameLabel') is assigned to the size of the 'lblSzRfrnceInput' parameter.
2nd output variable('alertTrigLabel') can be of variying sizes depending on the 'barCnt' parameter...BUT the smallest
size possible for the 2nd output variable ('alertTrigLabel') will be the size set in the 'lblSzRfrnceInput' parameter.
เอกสารเผยแพร่
v6

Updated:
TickerString(tickers, inEachGroup, whichGroup)
  TickerString: This function extracts the string from the entire list of assets you will be scanning.
  Parameters:
    tickers (simple string): (string)
This is the entire list of assets you will be scanning.

    inEachGroup (simple int): (int)
How many assets will be in each group for this scanner (hard-coded/set by COMET Scanner Author).

    whichGroup (simple int): (int)
Which set/group of assets that particular iteration/copy of the scanner will be scanning.

  Returns: Returns a string containing all the assets being scanned as determined by the amount of assets in each group and which group of the lot is being scanned.
เอกสารเผยแพร่
v7
เอกสารเผยแพร่
v8
เอกสารเผยแพร่
v9
เอกสารเผยแพร่
v10
เอกสารเผยแพร่
v11

Added:
GetSet(coinString, _perSet, setNumber)
  getCoinSet: This function splits a large coin string into an array and extracts a specific subset based on user-defined parameters.
  Parameters:
    coinString (string): (string)
A string containing all coin symbols separated by commas(NO SPACES...JUDST COMMAS)
    _perSet (int): (int)
The number of coins in each set (integer).
    setNumber (int): (int)
The set number to extract (integer).
  Returns: Returns a string array with all the coins to be further processed by the security function.

Updated:
Locations(_set, _perSet)
  Alert Label Locations: Assigns locations on the scale for each asset's alert labels.
Ensures that when multiple alerts are triggered, the labels remain visible and do not overlap.
The first asset's location is set to '_firstLocation'; subsequent assets' locations increment by 1.
The number of locations generated matches the number of coins in the set, specified by '_perSet'.
  Parameters:
    _set (simple int): (simple int)
Optional (defaults to 1 if not specified).
Which 'set' of assets you want to call from the string of all assets.
    _perSet (simple int): (simple int)
Optinal (defaults to 40 if not specified).
The number of coins in each set / Determines how many location indices are generated.
  Returns: An array of integers representing the locations for the alert labels. The length of the array equals '_perSet'.

InvalidTickerIDs(_close, _securityTickerid, _invalidArray, _tablePosition, _stackVertical)
  INVALID TICKERIDs: This is to add a table in the middle right of your chart that prints all the TickerID's that were either not formulated
correctly in the '_source' input or that is not a valid symbol and should be changed.
  Parameters:
    _close (float): (float)
Put your 'close' variable named '_close' from the security function here.
    _securityTickerid (string): (string)
Throughout the entire charts updates, if a '_close' value is never registered then the logic counts the asset as INVALID.
This will be the 1st TickerID variable (named _securityTickerid) outputted from the tuple of the TickeridForLabels()
function above this one.
    _invalidArray (array<string>): (array string)
Input the array from the original script that houses all of the invalidArray strings.
    _tablePosition (simple string): (string)
Optional (if parameter not included, it defaults to position.middle_right). Location on the chart you want the table printed.
Possible strings include: position.top_center, position.top_left, position.top_right, position.middle_center,
position.middle_left, position.middle_right, position.bottom_center, position.bottom_left, position.bottom_right.
    _stackVertical (simple bool): (bool)
Optional (if parameter not included, it defaults to true). All of the assets that are counted as INVALID will be
created in a list. If you want this list to be prited as a column then input 'true' here, otherwise they will all be in a row.
  Returns: ([string,string])
Returns 2 variables:
1st output variable ('AssetNameLabel') is assigned to the size of the 'lblSzRfrnceInput' parameter.
2nd output variable('alertTrigLabel') can be of variying sizes depending on the 'barCnt' parameter...BUT the smallest
size possible for the 2nd output variable ('alertTrigLabel') will be the size set in the 'lblSzRfrnceInput' parameter.

PrintedBarCount(_time, _barCntLength, _barCntPercentMin)
  The Printed BarCount Filter looks back a User Defined amount of minutes and calculates the % of bars that have printed
out of the TOTAL amount of bars that COULD HAVE been printed within the same amount of time.
  Parameters:
    _time (int): (int)
The time associated with the chart of the particular asset that is being screened at that point.
    _barCntLength (int): (int)
The amount of time (IN MINUTES) that you want the logic to look back at to calculate the % of bars that have actually
printed in the span of time you input into this parameter.
    _barCntPercentMin (int): (int)
The minimum % of Printed Bars of the asset being screened has to be GREATER than the value set in this parameter
for the output variable 'bc_gtg' to be true.
  Returns: ([float, bool])
Returns 2 outputs:
1st is the % of Printed Bars that have printed within the within the span of time you input in the '_barCntLength' parameter.
2nd is true/false according to if the Printed BarCount % is above the threshold that you input into the '_barCntPercentMin' parameter.

Removed:
TickerString(tickers, inEachGroup, whichGroup)
  TickerString: This function extracts the string from the entire list of assets you will be scanning.

TickerIDs(_string)
  TickerIDs: You must form this single tickerID input string exactly as described in the scripts info panel (little gray 'i' that
is circled at the end of the settings in the settings/input panel that you can hover your cursor over this 'i' to read the
details of that particular input). IF the string is formed correctly then it will break up this single string parameter into
a total of 40 separate strings which will be all of the tickerIDs that the script is using in your COMET Scanner.

LabelSize(_barCnt, _lblSzRfrnce)
  INVALID TICKERIDs: This is to add a table in the middle right of your chart that prints all the TickerID's that were either not formulated
correctly in the '_source' input or that is not a valid symbol and should be changed.

LABEL SIZES: This function sizes your Alert Trigger Labels according to the amount of Printed Bars the chart has printed within
a set time period, while also keeping in mind the smallest relative reference size you input in the 'lblSzRfrnceInput'
parameter of this function. A HIGHER % of Printed Bars(aka...more trades occurring for that asset on the exchange),
the LARGER the Name Label will print, potentially showing you the better opportunities on the exchange to avoid
exchange manipulation liquidations.
*** SHOULD NOT be used as size of labels that are your asset Name Labels next to each asset's Line Plot...
if your COMET Scanner includes these as you want these to be the same size for every asset so the larger ones dont cover the
smaller ones if the plots are all close to each other ***
เอกสารเผยแพร่
v12

Added:
get_TickID_Names_Locations(tIDstring, nIDstring, useLocation, _perSet, setNumber)
  GetSetAndLocations: Combines the extraction of ticker IDs, user-friendly name IDs, and alert label locations in one function.
Dynamically adjusts outputs based on user-defined parameters.
  Parameters:
    tIDstring (string): (string)
A string containing all ticker symbols separated by commas (NO SPACES, JUST COMMAS).
    nIDstring (string): (string)
A string containing all user-friendly name IDs separated by commas (NO SPACES, JUST COMMAS).
    useLocation (bool): (bool)
If true, generates a `locArray` containing locations for alert labels.
If false, outputs a blank `locArray` with the correct length.
    _perSet (int): (int)
The number of assets in each set (integer).
    setNumber (int): (int)
The set number to extract (integer).
  Returns: Returns a tuple of three arrays:
- tIDs: A string array of ticker IDs for the specified set.
- nIDs: A string array of name IDs for the specified set.
- locArray: An integer array of alert label locations (or blank if `useLocation` is false).

Removed:
GetSet(coinString, _perSet, setNumber)
  getCoinSet: This function splits a large coin string into an array and extracts a specific subset based on user-defined parameters.

Locations(_set, _perSet)
  Alert Label Locations: Assigns locations on the scale for each asset's alert labels.
Ensures that when multiple alerts are triggered, the labels remain visible and do not overlap.
The first asset's location is set to '_firstLocation'; subsequent assets' locations increment by 1.
The number of locations generated matches the number of coins in the set, specified by '_perSet'.
เอกสารเผยแพร่
v13

Removed:
PrintedBarCount(_time, _barCntLength, _barCntPercentMin)
  The Printed BarCount Filter looks back a User Defined amount of minutes and calculates the % of bars that have printed
out of the TOTAL amount of bars that COULD HAVE been printed within the same amount of time.
alertsATEa_traders_edgecometcomet_scannerscannerstatisticstechindicator

ไลบรารีไพน์

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนได้เผยแพร่ Pine code นี้เป็นโอเพนซอร์ซไลบรารีเพื่อให้ Pine โปรแกรมเมอร์คนอื่นในชุมชนของเราสามารถนำไปใช้ซ้ำได้ ต้องขอบคุณผู้เขียน! คุณสามารถใช้ไลบรารีนี้ในแบบส่วนตัวหรือในการเผยแพร่แบบโอเพนซอร์สอื่น ๆ แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน


และใน:

คำจำกัดสิทธิ์ความรับผิดชอบ