Orderly network hooks.utils
Orderly SDKs / Modules / @orderly.network/hooks / utils
Namespace: utils
@orderly.network/hooks.utils
Table of contents
References
Functions
- findPositionTPSLFromOrders
- findTPSLFromOrder
- findTPSLFromOrders
- formatNumber
- getPositionBySymbol
- priceToPnl
References
cleanStringStyle
Re-exports cleanStringStyle
Functions
findPositionTPSLFromOrders
▸ findPositionTPSLFromOrders(orders
, symbol
): undefined
| AlgoOrder
Parameters
Name | Type |
---|---|
orders | AlgoOrder [] |
symbol | string |
Returns
undefined
| AlgoOrder
Defined in
packages/hooks/src/orderly/usePositionStream/utils.ts:53
findTPSLFromOrder
▸ findTPSLFromOrder(order
): Object
Parameters
Name | Type |
---|---|
order | AlgoOrder |
Returns
Object
Name | Type |
---|---|
sl_trigger_price? | number |
tp_trigger_price? | number |
Defined in
packages/hooks/src/orderly/usePositionStream/utils.ts:21
findTPSLFromOrders
▸ findTPSLFromOrders(orders
, symbol
): undefined
| Partial
<Omit
<BaseAlgoOrderEntity
<STOP
>, "order_type"
| "child_orders"
>>
Parameters
Name | Type |
---|---|
orders | AlgoOrder [] |
symbol | string |
Returns
undefined
| Partial
<Omit
<BaseAlgoOrderEntity
<STOP
>, "order_type"
| "child_orders"
>>
Defined in
packages/hooks/src/orderly/usePositionStream/utils.ts:9
formatNumber
▸ formatNumber(qty?
, dp?
): string
| undefined
Parameters
Name | Type |
---|---|
qty? | string | number |
dp? | string | number |
Returns
string
| undefined
Defined in
packages/hooks/src/utils/orderEntryHelper.ts:311
getPositionBySymbol
▸ getPositionBySymbol(symbol
): void
Parameters
Name | Type |
---|---|
symbol | string |
Returns
void
Defined in
packages/hooks/src/utils/swr.ts:295
priceToPnl
▸ priceToPnl(inputs
, options?
): number
TP/SL price -> pnl
Parameters
Name | Type |
---|---|
inputs | Object |
inputs.entryPrice | number |
inputs.orderSide | OrderSide |
inputs.orderType | AlgoOrderType |
inputs.price | number |
inputs.qty | number |
options | Object |
options.symbol? | SymbolExt |
Returns
number
Defined in
packages/hooks/src/orderly/useTakeProfitAndStopLoss/utils.ts:203