PINE LIBRARY
업데이트됨 Scaled Order Sizing and Take Profit Target Arrays

WOAH Order Scaling!
This Provides a user with methods to create a list of profit targets and order sizes which grow or shrink. For size, the will add up to specific sum. for Targets they will include the first and last, and can lean towards either, to scale the order grid.
And thanks to HoanGhetti for the markdown, i've included a basic usage example within the hover , o you don't need to search for the usage example, simply import, and when writing, the code hint contains a full example.
scaled_sizes(total_size, count, weight, min_size, as_percent)
create an array of sizes which grow or shrink from first to last
which add up to 1.0 if set the as_percent flag , or a total value / sum.
Parameters:
total_size: (float) total size to divide ito split
count: (int ) desired number of splits to create
weight: (float) a weight to apply to grow or shrink the split either towards the last being most, or the first being most, or 1.0 being each is equally sized as 1/n count
min_size: (float) a minimum size for the smallest value (in value of ttotal_size units)
as_percent: (float) a minimum size for the smallest value (in value of total_size units)
Returns: Array of Sizes for each split
scaled_targets(count, weight, minimum, maximum)
create a list of take profitt targets from the smallest to larget distance
Parameters:
count: (int ) number of targets
weight: (float) weight to apply to growing or shrinking
minimum: (float) first value of the output
maximum: (float) last value of the output
Returns: Array of percentage targets
This Provides a user with methods to create a list of profit targets and order sizes which grow or shrink. For size, the will add up to specific sum. for Targets they will include the first and last, and can lean towards either, to scale the order grid.
And thanks to HoanGhetti for the markdown, i've included a basic usage example within the hover , o you don't need to search for the usage example, simply import, and when writing, the code hint contains a full example.
scaled_sizes(total_size, count, weight, min_size, as_percent)
create an array of sizes which grow or shrink from first to last
which add up to 1.0 if set the as_percent flag , or a total value / sum.
Parameters:
total_size: (float) total size to divide ito split
count: (int ) desired number of splits to create
weight: (float) a weight to apply to grow or shrink the split either towards the last being most, or the first being most, or 1.0 being each is equally sized as 1/n count
min_size: (float) a minimum size for the smallest value (in value of ttotal_size units)
as_percent: (float) a minimum size for the smallest value (in value of total_size units)
Returns: Array of Sizes for each split
scaled_targets(count, weight, minimum, maximum)
create a list of take profitt targets from the smallest to larget distance
Parameters:
count: (int ) number of targets
weight: (float) weight to apply to growing or shrinking
minimum: (float) first value of the output
maximum: (float) last value of the output
Returns: Array of percentage targets
릴리즈 노트
v2Added:
method scaled_order_array(total_size, count, tp_weight, tp_min, tp_max, size_weight, min_size, as_percent)
# Creates target Objects with combined info.
----
Creates a list of take profitt targets from the smallest to larget distance
and a set of sizes for each which add up to the total size
Combines them into Target OPbjecs
### `example`
```
total_size = input(100, 'USD order size') / close
count = input(5 , 'Order count')
tp_weight = input(100, 'Grow/Shrink') / 100
tp_min = input(10, ' Min TP') / 100
tp_max = input(0.55, 'Max TP') / 100
size_weight = input(100, 'Grow/Shrink') / 100
min_size = input(10, ' Min Required Order') / close
// Call
scaled_order_array(total_size, count, tp_weight, tp_min, tp_max, size_weight, min_size)
```
Namespace types: series float, simple float, input float, const float
Parameters:
total_size (float): (float) total size to divide ito split
count (int): (int ) desired number of splits to create
tp_weight (float): (float) a weight to apply to grow or shrink the target prices
tp_min (float): (float) a minimum target
tp_max (float): (float) a maximum target
size_weight (float): (float) a weight to apply to grow or shrink the split either towards the last being most, or the first being most, or 1.0 being each is equally sized as 1/n count
min_size (float): (float) a minimum size for the smallest value (in value of ttotal_size units)
as_percent (bool): (bool) Use percent for size
Returns: Array of Sizes for each split
target
Target Objects contain Informations for the order placement
Fields:
price (series float): The price for the order
size (series float): The size for the order
ispct_prc (series bool): Is the price a percentage
ispct_sz (series bool): Is the size a percentage
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.