PINE LIBRARY
ที่อัปเดต: RiskTools

Library "RiskTools"
Provides functions for calculating risk metrics
pctDrop(start, result)
Calculates what is the percentage drop from a reference price
Parameters:
start (float): Starting price before the drop occurred
result (float): Resulting price to which the percentage drop occurred
Returns: Percentage drop from "start" to "result"
priceBeforeDrop(pctDrop, result)
Calculates a starting price given a resulting price and a percentage drop to that price
Parameters:
pctDrop (float): Percentage drop
result (float): Resulting price to which the percentage drop occurred
Returns: The starting price from which a percentage drop "pctDrop" gave a "result"
dropzone(price, masource, malength, window, zonesize)
Calculates drop zone as an integer representing some multiple of the "zoning size"
Parameters:
price (float): The current price from which you want to calculate the drop zone
masource (float): The source series used in the SMA calculation from which the floor price is determined
malength (simple int): The length used in the SMA calculation from which the floor price is determined
window (simple int): The lookback period from which to calculate the floor price
zonesize (simple int)
Returns: The zone identifier as a multiple of the zone size. A value of zero or less is translated to the first zone.
Provides functions for calculating risk metrics
pctDrop(start, result)
Calculates what is the percentage drop from a reference price
Parameters:
start (float): Starting price before the drop occurred
result (float): Resulting price to which the percentage drop occurred
Returns: Percentage drop from "start" to "result"
priceBeforeDrop(pctDrop, result)
Calculates a starting price given a resulting price and a percentage drop to that price
Parameters:
pctDrop (float): Percentage drop
result (float): Resulting price to which the percentage drop occurred
Returns: The starting price from which a percentage drop "pctDrop" gave a "result"
dropzone(price, masource, malength, window, zonesize)
Calculates drop zone as an integer representing some multiple of the "zoning size"
Parameters:
price (float): The current price from which you want to calculate the drop zone
masource (float): The source series used in the SMA calculation from which the floor price is determined
malength (simple int): The length used in the SMA calculation from which the floor price is determined
window (simple int): The lookback period from which to calculate the floor price
zonesize (simple int)
Returns: The zone identifier as a multiple of the zone size. A value of zero or less is translated to the first zone.
เอกสารเผยแพร่
v2Updated:
priceBeforeDrop(pctdrop, result)
Calculates a starting price given a resulting price and a percentage drop to that price
Parameters:
pctdrop (float): Percentage drop
result (float): Resulting price to which the percentage drop occurred
Returns: The starting price from which a percentage drop "pctDrop" gave a "result"
dropzone(price, masource, malength_days, window_days, zonesize)
Calculates drop zone as an integer representing some multiple of the "zoning size"
Parameters:
price (float): The current price from which you want to calculate the drop zone
masource (float): The source series used in the SMA calculation from which the floor price is determined
malength_days (simple int): The length (in days) used in the SMA calculation from which the floor price is determined
window_days (simple int): The lookback period (in days) from which to calculate the floor price
zonesize (simple int): The lookback period from which to calculate the floor price
Returns: The zone identifier as a multiple of the zone size. A value of zero or less is translated to the first zone.
เอกสารเผยแพร่
v3Updated:
dropzone(price, masource, malength_days, window_days, zonesize, firstzone)
Calculates drop zone as an integer representing some multiple of the "zoning size"
Parameters:
price (float): The current price from which you want to calculate the drop zone
masource (float): The source series used in the SMA calculation from which the floor price is determined
malength_days (simple int): The length (in days) used in the SMA calculation from which the floor price is determined
window_days (simple int): The lookback period (in days) from which to calculate the floor price
zonesize (simple int): The increment by which each new zone is larger than the next
firstzone (simple int): The first valid zone number, if ommitted it defaults to the first zonesize increment
Returns: The zone identifier as a multiple of the zone size. A value of zero or less is translated to the first zone.
เอกสารเผยแพร่
v4Updated:
dropzone(price, masource, malength_days, window_days, zonesize, firstzone, lastzone)
Calculates drop zone as an integer representing some multiple of the "zoning size"
Parameters:
price (float): The current price from which you want to calculate the drop zone
masource (float): The source series used in the SMA calculation from which the floor price is determined
malength_days (simple int): The length (in days) used in the SMA calculation from which the floor price is determined
window_days (simple int): The lookback period (in days) from which to calculate the floor price
zonesize (simple int): The increment by which each new zone is larger than the next
firstzone (simple int): The first valid zone number, if ommitted it defaults to the first zonesize increment
lastzone (simple int)
Returns: The zone identifier as a multiple of the zone size. A value of zero or less is translated to the first zone.
เอกสารเผยแพร่
v5เอกสารเผยแพร่
v6Updated:
dropzone(price, masource, malength_days, window_days, zonesize, minuszone, firstzone, lastzone)
Calculates drop zone as an integer representing some multiple of the "zoning size"
Parameters:
price (float): The current price from which you want to calculate the drop zone
masource (float): The source series used in the SMA calculation from which the floor price is determined
malength_days (simple int): The length (in days) used in the SMA calculation from which the floor price is determined
window_days (simple int): The lookback period (in days) from which to calculate the floor price
zonesize (simple int): The increment by which each new zone is larger than the next
minuszone (simple int): The zone number to use if price is below the floor price. If ommitted it defaults to zero (0)
firstzone (simple int): The first valid zone number. If ommitted it defaults to the first zonesize increment
lastzone (simple int): The last zone number where price is above the final zone.
Returns: The zone identifier as a multiple of the zone size in string format
เอกสารเผยแพร่
v7Updated:
dropzone(price, masource, malength_days, window_days, zonesize, minuszone, firstzone, lastzone, overzone)
Calculates drop zone as an integer representing some multiple of the "zoning size"
Parameters:
price (float): The current price from which you want to calculate the drop zone
masource (float): The source series used in the SMA calculation from which the floor price is determined
malength_days (simple int): The length (in days) used in the SMA calculation from which the floor price is determined
window_days (simple int): The lookback period (in days) from which to calculate the floor price
zonesize (simple int): The increment by which each new zone is larger than the next
minuszone (simple int): The zone number to use if price is below the floor price. If ommitted it defaults to zero (0)
firstzone (simple int): The first valid zone number. If ommitted it defaults to the first zonesize increment
lastzone (simple int): The last zone number where price is above the final zone.
overzone (simple int)
Returns: The zone identifier as a multiple of the zone size in string format
ไลบรารีไพน์
ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนได้เผยแพร่ Pine code นี้เป็นโอเพนซอร์สไลบรารีเพื่อให้ Pine โปรแกรมเมอร์คนอื่นในชุมชนของเราสามารถนำไปใช้ซ้ำได้ ต้องขอบคุณผู้เขียน! คุณสามารถใช้ไลบรารีนี้ในแบบส่วนตัวหรือในการเผยแพร่แบบโอเพนซอร์สอื่น ๆ แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
ไลบรารีไพน์
ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนได้เผยแพร่ Pine code นี้เป็นโอเพนซอร์สไลบรารีเพื่อให้ Pine โปรแกรมเมอร์คนอื่นในชุมชนของเราสามารถนำไปใช้ซ้ำได้ ต้องขอบคุณผู้เขียน! คุณสามารถใช้ไลบรารีนี้ในแบบส่วนตัวหรือในการเผยแพร่แบบโอเพนซอร์สอื่น ๆ แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน