Built-in Functions
Structures
Ticker
Depth
OrderBook
Trade
Record
Market
Order
Condition
Account
Asset
Position
Funding
Other Structures
Built-in Variables and Constants
Conventions
Exchanges
progress
Shows a ratio, or current value / total, as a bar.
Examples
Shows the share of frozen funds and today's order count against a cap.
javascript
function main() {
var account = exchange.GetAccount()
if (!account) return
var total = account.Balance + account.FrozenBalance
var frozen = total > 0 ? account.FrozenBalance / total : 0
var orders = 3 // Order count kept by the strategy
LogStatus([
{type: "progress", title: "Frozen share", value: frozen},
{type: "progress", title: "Orders today", value: orders, max: 20, color: "warning"}
])
}
python
def main():
account = exchange.GetAccount()
if not account:
return
total = account["Balance"] + account["FrozenBalance"]
frozen = account["FrozenBalance"] / total if total > 0 else 0
orders = 3 # Order count kept by the strategy
LogStatus([
{"type": "progress", "title": "Frozen share", "value": frozen},
{"type": "progress", "title": "Orders today", "value": orders, "max": 20,
"color": "warning"}
])
rust
fn main() {
let Ok(a) = exchange.GetAccount() else { return };
let total = a.Balance + a.FrozenBalance;
let frozen = if total > 0.0 { a.FrozenBalance / total } else { 0.0 };
let orders = 3; // Order count kept by the strategy
LogStatus!(format!(
r#"[{{"type": "progress", "title": "Frozen share", "value": {}}},
{{"type": "progress", "title": "Orders today", "value": {}, "max": 20,
"color": "warning"}}]"#,
frozen, orders
));
}Attributes
| Name | Type | Description |
type | string | Required. Always |
value | number | Required. Current value. |
max | number | Total. When given the bar shows |
color | string | Bar color, default |
title | string | Title shown at the top left of the component. |
id | string | Stable identifier. Set it when the number or order of components changes, so refreshes do not rebuild the component. |
span | number | Number of columns it spans in the enclosing |
See Also